Merge branch 'develop_sky' into 'canary_release_sky'
Develop sky See merge request StarlockTeam/app-starlock!110
This commit is contained in:
commit
7105f16daa
@ -16,10 +16,10 @@ variables:
|
||||
- macos
|
||||
- flutter
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "develop"
|
||||
- if: $CI_COMMIT_BRANCH == "release"
|
||||
- if: $CI_COMMIT_BRANCH == "develop_sky"
|
||||
- if: $CI_COMMIT_BRANCH == "release_sky"
|
||||
- if: $CI_COMMIT_BRANCH =~ /feat_[a-zA-Z]+/
|
||||
- if: $CI_COMMIT_BRANCH == "canary_release"
|
||||
- if: $CI_COMMIT_BRANCH == "canary_release_sky"
|
||||
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$/
|
||||
|
||||
.notify_rule:
|
||||
@ -27,8 +27,8 @@ variables:
|
||||
- macos
|
||||
- flutter
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "develop"
|
||||
- if: $CI_COMMIT_BRANCH == "release"
|
||||
- if: $CI_COMMIT_BRANCH == "develop_sky"
|
||||
- if: $CI_COMMIT_BRANCH == "release_sky"
|
||||
- if: $CI_COMMIT_BRANCH =~ /feat_[a-zA-Z]+/
|
||||
|
||||
.generate_tag_rule:
|
||||
@ -36,16 +36,16 @@ variables:
|
||||
- macos
|
||||
- flutter
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "master"
|
||||
- if: $CI_COMMIT_BRANCH == "master_sky"
|
||||
|
||||
.generate_next_version_rule:
|
||||
tags:
|
||||
- macos
|
||||
- flutter
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "develop"
|
||||
- if: $CI_COMMIT_BRANCH == "release"
|
||||
- if: $CI_COMMIT_BRANCH == "canary_release"
|
||||
- if: $CI_COMMIT_BRANCH == "develop_sky"
|
||||
- if: $CI_COMMIT_BRANCH == "release_sky"
|
||||
- if: $CI_COMMIT_BRANCH == "canary_release_sky"
|
||||
- if: $CI_COMMIT_BRANCH =~ /feat_[a-zA-Z]+/
|
||||
|
||||
.print_env:
|
||||
@ -62,7 +62,7 @@ variables:
|
||||
before_script:
|
||||
- ls -li
|
||||
- export NEXT_VERSION="$(cat app_new.version)"
|
||||
# - flutter pub get
|
||||
# - flutter pub get
|
||||
- export PATH="/opt/homebrew/bin:$PATH"
|
||||
- eval "$(rbenv init -)"
|
||||
- bundle config mirror.https://rubygems.org https://gems.ruby-china.com
|
||||
@ -76,7 +76,7 @@ variables:
|
||||
before_script:
|
||||
- ls -li
|
||||
- export NEXT_VERSION="$(cat app_new.version)"
|
||||
# - flutter pub get
|
||||
# - flutter pub get
|
||||
- export PATH="/opt/homebrew/bin:$PATH"
|
||||
- eval "$(rbenv init -)"
|
||||
- bundle config mirror.https://rubygems.org https://gems.ruby-china.com
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# 星锁APP
|
||||
|
||||
测试ci
|
||||
星云项目组旗下的智能锁应用,其中锁相关数据接入星云平台,业务数据接入星锁自有后台。
|
||||
|
||||
基于Flutter技术架构,支持Android和iOS平台。
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "fastlane"
|
||||
|
||||
gem 'nkf', '0.2.0'
|
||||
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
|
||||
eval_gemfile(plugins_path) if File.exist?(plugins_path)
|
||||
|
||||
231
android/Gemfile.lock
Normal file
231
android/Gemfile.lock
Normal file
@ -0,0 +1,231 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.7)
|
||||
base64
|
||||
nkf
|
||||
rexml
|
||||
addressable (2.8.7)
|
||||
public_suffix (>= 2.0.2, < 7.0)
|
||||
artifactory (3.0.17)
|
||||
atomos (0.1.3)
|
||||
aws-eventstream (1.3.2)
|
||||
aws-partitions (1.1107.0)
|
||||
aws-sdk-core (3.224.0)
|
||||
aws-eventstream (~> 1, >= 1.3.0)
|
||||
aws-partitions (~> 1, >= 1.992.0)
|
||||
aws-sigv4 (~> 1.9)
|
||||
base64
|
||||
jmespath (~> 1, >= 1.6.1)
|
||||
logger
|
||||
aws-sdk-kms (1.101.0)
|
||||
aws-sdk-core (~> 3, >= 3.216.0)
|
||||
aws-sigv4 (~> 1.5)
|
||||
aws-sdk-s3 (1.186.1)
|
||||
aws-sdk-core (~> 3, >= 3.216.0)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.5)
|
||||
aws-sigv4 (1.11.0)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
babosa (1.0.4)
|
||||
base64 (0.2.0)
|
||||
claide (1.1.0)
|
||||
colored (1.2)
|
||||
colored2 (3.1.2)
|
||||
commander (4.6.0)
|
||||
highline (~> 2.0.0)
|
||||
declarative (0.0.20)
|
||||
digest-crc (0.7.0)
|
||||
rake (>= 12.0.0, < 14.0.0)
|
||||
domain_name (0.5.20190701)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
dotenv (2.8.1)
|
||||
emoji_regex (3.2.3)
|
||||
excon (0.109.0)
|
||||
faraday (1.10.4)
|
||||
faraday-em_http (~> 1.0)
|
||||
faraday-em_synchrony (~> 1.0)
|
||||
faraday-excon (~> 1.1)
|
||||
faraday-httpclient (~> 1.0)
|
||||
faraday-multipart (~> 1.0)
|
||||
faraday-net_http (~> 1.0)
|
||||
faraday-net_http_persistent (~> 1.0)
|
||||
faraday-patron (~> 1.0)
|
||||
faraday-rack (~> 1.0)
|
||||
faraday-retry (~> 1.0)
|
||||
ruby2_keywords (>= 0.0.4)
|
||||
faraday-cookie_jar (0.0.7)
|
||||
faraday (>= 0.8.0)
|
||||
http-cookie (~> 1.0.0)
|
||||
faraday-em_http (1.0.0)
|
||||
faraday-em_synchrony (1.0.0)
|
||||
faraday-excon (1.1.0)
|
||||
faraday-httpclient (1.0.1)
|
||||
faraday-multipart (1.1.0)
|
||||
multipart-post (~> 2.0)
|
||||
faraday-net_http (1.0.2)
|
||||
faraday-net_http_persistent (1.2.0)
|
||||
faraday-patron (1.0.0)
|
||||
faraday-rack (1.0.0)
|
||||
faraday-retry (1.0.3)
|
||||
faraday_middleware (1.2.1)
|
||||
faraday (~> 1.0)
|
||||
fastimage (2.4.0)
|
||||
fastlane (2.227.2)
|
||||
CFPropertyList (>= 2.3, < 4.0.0)
|
||||
addressable (>= 2.8, < 3.0.0)
|
||||
artifactory (~> 3.0)
|
||||
aws-sdk-s3 (~> 1.0)
|
||||
babosa (>= 1.0.3, < 2.0.0)
|
||||
bundler (>= 1.12.0, < 3.0.0)
|
||||
colored (~> 1.2)
|
||||
commander (~> 4.6)
|
||||
dotenv (>= 2.1.1, < 3.0.0)
|
||||
emoji_regex (>= 0.1, < 4.0)
|
||||
excon (>= 0.71.0, < 1.0.0)
|
||||
faraday (~> 1.0)
|
||||
faraday-cookie_jar (~> 0.0.6)
|
||||
faraday_middleware (~> 1.0)
|
||||
fastimage (>= 2.1.0, < 3.0.0)
|
||||
fastlane-sirp (>= 1.0.0)
|
||||
gh_inspector (>= 1.1.2, < 2.0.0)
|
||||
google-apis-androidpublisher_v3 (~> 0.3)
|
||||
google-apis-playcustomapp_v1 (~> 0.1)
|
||||
google-cloud-env (>= 1.6.0, < 2.0.0)
|
||||
google-cloud-storage (~> 1.31)
|
||||
highline (~> 2.0)
|
||||
http-cookie (~> 1.0.5)
|
||||
json (< 3.0.0)
|
||||
jwt (>= 2.1.0, < 3)
|
||||
mini_magick (>= 4.9.4, < 5.0.0)
|
||||
multipart-post (>= 2.0.0, < 3.0.0)
|
||||
naturally (~> 2.2)
|
||||
optparse (>= 0.1.1, < 1.0.0)
|
||||
plist (>= 3.1.0, < 4.0.0)
|
||||
rubyzip (>= 2.0.0, < 3.0.0)
|
||||
security (= 0.1.5)
|
||||
simctl (~> 1.6.3)
|
||||
terminal-notifier (>= 2.0.0, < 3.0.0)
|
||||
terminal-table (~> 3)
|
||||
tty-screen (>= 0.6.3, < 1.0.0)
|
||||
tty-spinner (>= 0.8.0, < 1.0.0)
|
||||
word_wrap (~> 1.0.0)
|
||||
xcodeproj (>= 1.13.0, < 2.0.0)
|
||||
xcpretty (~> 0.4.1)
|
||||
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
|
||||
fastlane-plugin-pgyer (0.2.9)
|
||||
fastlane-sirp (1.0.0)
|
||||
sysrandom (~> 1.0)
|
||||
gh_inspector (1.1.3)
|
||||
google-apis-androidpublisher_v3 (0.54.0)
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
google-apis-core (0.11.3)
|
||||
addressable (~> 2.5, >= 2.5.1)
|
||||
googleauth (>= 0.16.2, < 2.a)
|
||||
httpclient (>= 2.8.1, < 3.a)
|
||||
mini_mime (~> 1.0)
|
||||
representable (~> 3.0)
|
||||
retriable (>= 2.0, < 4.a)
|
||||
rexml
|
||||
google-apis-iamcredentials_v1 (0.17.0)
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
google-apis-playcustomapp_v1 (0.13.0)
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
google-apis-storage_v1 (0.29.0)
|
||||
google-apis-core (>= 0.11.0, < 2.a)
|
||||
google-cloud-core (1.6.1)
|
||||
google-cloud-env (>= 1.0, < 3.a)
|
||||
google-cloud-errors (~> 1.0)
|
||||
google-cloud-env (1.6.0)
|
||||
faraday (>= 0.17.3, < 3.0)
|
||||
google-cloud-errors (1.3.1)
|
||||
google-cloud-storage (1.45.0)
|
||||
addressable (~> 2.8)
|
||||
digest-crc (~> 0.4)
|
||||
google-apis-iamcredentials_v1 (~> 0.1)
|
||||
google-apis-storage_v1 (~> 0.29.0)
|
||||
google-cloud-core (~> 1.6)
|
||||
googleauth (>= 0.16.2, < 2.a)
|
||||
mini_mime (~> 1.0)
|
||||
googleauth (1.8.1)
|
||||
faraday (>= 0.17.3, < 3.a)
|
||||
jwt (>= 1.4, < 3.0)
|
||||
multi_json (~> 1.11)
|
||||
os (>= 0.9, < 2.0)
|
||||
signet (>= 0.16, < 2.a)
|
||||
highline (2.0.3)
|
||||
http-cookie (1.0.8)
|
||||
domain_name (~> 0.5)
|
||||
httpclient (2.9.0)
|
||||
mutex_m
|
||||
jmespath (1.6.2)
|
||||
json (2.7.6)
|
||||
jwt (2.10.1)
|
||||
base64
|
||||
logger (1.7.0)
|
||||
mini_magick (4.13.2)
|
||||
mini_mime (1.1.5)
|
||||
multi_json (1.15.0)
|
||||
multipart-post (2.4.1)
|
||||
mutex_m (0.3.0)
|
||||
nanaimo (0.4.0)
|
||||
naturally (2.2.1)
|
||||
nkf (0.2.0)
|
||||
optparse (0.6.0)
|
||||
os (1.1.4)
|
||||
plist (3.7.2)
|
||||
public_suffix (5.1.1)
|
||||
rake (13.2.1)
|
||||
representable (3.2.0)
|
||||
declarative (< 0.1.0)
|
||||
trailblazer-option (>= 0.1.1, < 0.2.0)
|
||||
uber (< 0.2.0)
|
||||
retriable (3.1.2)
|
||||
rexml (3.4.1)
|
||||
rouge (3.28.0)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.4.1)
|
||||
security (0.1.5)
|
||||
signet (0.18.0)
|
||||
addressable (~> 2.8)
|
||||
faraday (>= 0.17.5, < 3.a)
|
||||
jwt (>= 1.5, < 3.0)
|
||||
multi_json (~> 1.10)
|
||||
simctl (1.6.10)
|
||||
CFPropertyList
|
||||
naturally
|
||||
sysrandom (1.0.5)
|
||||
terminal-notifier (2.0.0)
|
||||
terminal-table (3.0.2)
|
||||
unicode-display_width (>= 1.1.1, < 3)
|
||||
trailblazer-option (0.1.2)
|
||||
tty-cursor (0.7.1)
|
||||
tty-screen (0.8.2)
|
||||
tty-spinner (0.9.3)
|
||||
tty-cursor (~> 0.7)
|
||||
uber (0.1.0)
|
||||
unf (0.2.0)
|
||||
unicode-display_width (2.6.0)
|
||||
word_wrap (1.0.0)
|
||||
xcodeproj (1.27.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.4.0)
|
||||
rexml (>= 3.3.6, < 4.0)
|
||||
xcpretty (0.4.1)
|
||||
rouge (~> 3.28.0)
|
||||
xcpretty-travis-formatter (1.0.1)
|
||||
xcpretty (~> 0.2, >= 0.0.7)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
fastlane
|
||||
fastlane-plugin-pgyer
|
||||
nkf (= 0.2.0)
|
||||
|
||||
BUNDLED WITH
|
||||
1.17.2
|
||||
@ -8,8 +8,9 @@ export ENV_BUILD_WORKSPACE=${CI_PROJECT_DIR}
|
||||
echo "GITLAB_WORKSPACE: ${CI_PROJECT_DIR}"
|
||||
cd ${CI_PROJECT_DIR}/android
|
||||
echo "ENV_BUILD_TAG:${ENV_BUILD_TAG},ENV_BUILD_BRANCH:${ENV_BUILD_BRANCH}"
|
||||
regex='^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$'
|
||||
if [[ "${ENV_BUILD_BRANCH}" == "canary_release" ]]; then
|
||||
# 只支持 v1.2.3_sky 这种tag格式
|
||||
regex='^v[0-9]+\.[0-9]+\.[0-9]+_sky$'
|
||||
if [[ "${ENV_BUILD_BRANCH}" == "canary_release_sky" ]]; then
|
||||
echo "===build canary_release: ${NEXT_VERSION}"
|
||||
export ENV_BUILD_TAG=${NEXT_VERSION}
|
||||
bundle exec fastlane release_apk flavor:xhj --verbose
|
||||
@ -20,11 +21,11 @@ elif [[ $ENV_BUILD_TAG =~ $regex ]]; then
|
||||
bundle exec fastlane release_apk flavor:sky --verbose
|
||||
bundle exec fastlane release_bundle flavor:xhj_bundle --verbose
|
||||
bundle exec fastlane release_bundle flavor:sky --verbose
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "develop" ]]; then
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "develop_sky" ]]; then
|
||||
echo "===build dev===${NEXT_VERSION}"
|
||||
bundle exec fastlane beta flavor:xhj env:dev --verbose
|
||||
bundle exec fastlane beta flavor:sky env:dev --verbose
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "release" ]] || [[ "${ENV_BUILD_BRANCH}" == "feat_devops" ]] ; then
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "release_sky" || "${ENV_BUILD_BRANCH}" == "feat_devops_sky" ]] ; then
|
||||
echo "===build pre===${NEXT_VERSION}"
|
||||
bundle exec fastlane beta flavor:xhj env:pre --verbose
|
||||
bundle exec fastlane beta flavor:sky env:pre --verbose
|
||||
|
||||
@ -3,5 +3,6 @@ source "https://rubygems.org"
|
||||
gem "fastlane"
|
||||
gem 'cocoapods', '1.14.3'
|
||||
gem 'public_suffix', '~> 4.0'
|
||||
gem 'nkf', '0.2.0'
|
||||
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
|
||||
eval_gemfile(plugins_path) if File.exist?(plugins_path)
|
||||
|
||||
@ -282,6 +282,7 @@ DEPENDENCIES
|
||||
cocoapods (= 1.14.3)
|
||||
fastlane
|
||||
fastlane-plugin-pgyer
|
||||
nkf (= 0.2.0)
|
||||
public_suffix (~> 4.0)
|
||||
|
||||
BUNDLED WITH
|
||||
|
||||
@ -9,8 +9,9 @@ echo "GITLAB_WORKSPACE: ${CI_PROJECT_DIR}"
|
||||
cd ${CI_PROJECT_DIR}/ios
|
||||
#bundle exec pod install
|
||||
echo "ENV_BUILD_TAG:${ENV_BUILD_TAG},ENV_BUILD_BRANCH:${ENV_BUILD_BRANCH}"
|
||||
regex='^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$'
|
||||
if [[ "${ENV_BUILD_BRANCH}" == "canary_release" ]]; then
|
||||
# 只支持 v1.2.3_sky 这种tag格式
|
||||
regex='^v[0-9]+\.[0-9]+\.[0-9]+_sky$'
|
||||
if [[ "${ENV_BUILD_BRANCH}" == "canary_release_sky" ]]; then
|
||||
echo "===build canary_release: ${NEXT_VERSION}"
|
||||
export ENV_BUILD_TAG=${NEXT_VERSION}
|
||||
bundle exec fastlane release_ipa flavor:xhj --verbose
|
||||
@ -19,11 +20,11 @@ elif [[ $ENV_BUILD_TAG =~ $regex ]]; then
|
||||
echo "===build release===$ENV_BUILD_TAG"
|
||||
bundle exec fastlane release_ipa flavor:xhj --verbose
|
||||
bundle exec fastlane release_ipa flavor:sky --verbose
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "develop" ]]; then
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "develop_sky" ]]; then
|
||||
echo "===build dev===${NEXT_VERSION}"
|
||||
bundle exec fastlane beta flavor:xhj env:Dev --verbose
|
||||
bundle exec fastlane beta flavor:sky env:Dev --verbose
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "release" ]] || [[ "${ENV_BUILD_BRANCH}" == "feat_devops" ]] ; then
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "release_sky" || "${ENV_BUILD_BRANCH}" == "feat_devops_sky" ]] ; then
|
||||
echo "===build pre===${NEXT_VERSION}"
|
||||
bundle exec fastlane beta flavor:xhj env:Pre --verbose
|
||||
bundle exec fastlane beta flavor:sky env:Pre --verbose
|
||||
|
||||
@ -89,7 +89,8 @@ platform :ios do
|
||||
sh("flutter","pub","get")
|
||||
end
|
||||
Dir.chdir ".." do
|
||||
sh("bundle", "exec" ,"pod", "install")
|
||||
#sh("bundle", "exec" ,"pod", "install")
|
||||
sh("pod", "install")
|
||||
end
|
||||
Dir.chdir "../.." do
|
||||
sh("flutter", "build", "ios", "--no-tree-shake-icons", "--no-codesign", "--release", "--flavor", "#{flavor}", "-t", "lib/main_#{flavor}_#{env}.dart", "--build-number=#{build_number}", "--build-name=#{build_version}")
|
||||
@ -142,7 +143,8 @@ platform :ios do
|
||||
sh("flutter","pub","get")
|
||||
end
|
||||
Dir.chdir ".." do
|
||||
sh("bundle", "exec" ,"pod", "install")
|
||||
#sh("bundle", "exec" ,"pod", "install")
|
||||
sh("pod", "install")
|
||||
end
|
||||
Dir.chdir "../.." do
|
||||
sh("flutter", "build", "ios", "--no-tree-shake-icons", "--no-codesign", "--release", "--flavor", "#{flavor}", "-t", "lib/main_#{flavor}_lite.dart", "--build-number=#{build_number}", "--build-name=#{build_version}")
|
||||
|
||||
@ -405,6 +405,7 @@ class FingerprintListLogic extends BaseGetXController {
|
||||
_teamEvent = eventBus
|
||||
.on<OtherTypeRefreshListEvent>()
|
||||
.listen((OtherTypeRefreshListEvent event) async {
|
||||
// 立即刷新数据
|
||||
await getFingerprintsListData(isRefresh: true);
|
||||
});
|
||||
}
|
||||
@ -459,8 +460,9 @@ class FingerprintListLogic extends BaseGetXController {
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
_initReplySubscription();
|
||||
_initRefreshAction();
|
||||
|
||||
// _initRefreshAction();
|
||||
// 初始加载数据
|
||||
await getFingerprintsListData(isRefresh: true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
@ -7,6 +6,8 @@ import 'package:star_lock/blue/io_protocol/io_updataLockRemoteControlList.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../../../app_settings/app_settings.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
@ -21,48 +22,56 @@ import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../blue/sender_manage.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
import 'uploadData_state.dart';
|
||||
|
||||
class UploadDataLogic extends BaseGetXController{
|
||||
UploadDataState state = UploadDataState();
|
||||
class UploadDataLogic extends BaseGetXController {
|
||||
final UploadDataState state = UploadDataState();
|
||||
|
||||
// 监听蓝牙协议返回结果
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
// 上传数据获取锁密码列表
|
||||
if (reply is UpdataLockPasswordListReply && (state.ifCurrentScreen.value == true)) {
|
||||
if (reply is UpdataLockPasswordListReply &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
_replyUpdataLockPasswordListReply(reply);
|
||||
}
|
||||
|
||||
// 上传数据获取锁卡列表
|
||||
if (reply is UpdataLockCardListReply && (state.ifCurrentScreen.value == true)) {
|
||||
if (reply is UpdataLockCardListReply &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
_replyUpdataLockCardListReply(reply);
|
||||
}
|
||||
|
||||
// 上传数据获取锁指纹列表
|
||||
if (reply is UpdataLockFingerprintListReply && (state.ifCurrentScreen.value == true)) {
|
||||
if (reply is UpdataLockFingerprintListReply &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
_replyUpdataLockFingerprintListReply(reply);
|
||||
}
|
||||
|
||||
// 上传数据获取锁人脸列表
|
||||
if (reply is UpdataLockFaceListReply && (state.ifCurrentScreen.value == true)) {
|
||||
if (reply is UpdataLockFaceListReply &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
_replyUpdataLockFaceListReply(reply);
|
||||
}
|
||||
|
||||
// 上传数据获取锁掌静脉列表
|
||||
if (reply is UpdataLockPalmVeinListReply && (state.ifCurrentScreen.value == true)) {
|
||||
if (reply is UpdataLockPalmVeinListReply &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
_replyUpdataLockPalmVeinListReply(reply);
|
||||
}
|
||||
|
||||
// 上传数据获取锁遥控
|
||||
if (reply is UpdataLockRemoteControlListReply && (state.ifCurrentScreen.value == true)) {
|
||||
if (reply is UpdataLockRemoteControlListReply &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
_replyUpdataLockRemoteControlListReply(reply);
|
||||
}
|
||||
|
||||
// 上传数据获取锁设置
|
||||
if (reply is UpdataLockSetReply && (state.ifCurrentScreen.value == true) && (state.ifSeletUpdataBtnState == true)) {
|
||||
if (reply is UpdataLockSetReply &&
|
||||
(state.ifCurrentScreen.value == true) &&
|
||||
(state.ifSeletUpdataBtnState == true)) {
|
||||
_replyUpdataLockSetReply(reply);
|
||||
}
|
||||
});
|
||||
@ -71,21 +80,22 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// 上传数据获取锁密码列表
|
||||
Future<void> _replyUpdataLockPasswordListReply(Reply reply) async {
|
||||
final int status = reply.data[2];
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
//成功
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final int dataLength = reply.data[8];
|
||||
state.uploadPasswordDataList.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if(dataLength == 10){
|
||||
state.uploadPasswordDataList
|
||||
.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if (dataLength == 10) {
|
||||
// 当数据是10的时候继续请求
|
||||
state.uploadPasswordPage = state.uploadPasswordPage + 1;
|
||||
|
||||
final List<int> token = reply.data.sublist(3, 7);
|
||||
showEasyLoading();
|
||||
updataLockPasswordList(token, state.uploadPasswordPage);
|
||||
}else{
|
||||
} else {
|
||||
// dismissEasyLoading();
|
||||
|
||||
// 当数据不是10的时候解析数据上传
|
||||
@ -95,12 +105,15 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// }else{
|
||||
// // 如果不是空的解析数据上传
|
||||
state.indexCount.value = state.indexCount.value + 1;
|
||||
_lockDataUpload(uploadType:2, recordType:2, records:state.uploadPasswordDataList);
|
||||
_lockDataUpload(
|
||||
uploadType: 2,
|
||||
recordType: 2,
|
||||
records: state.uploadPasswordDataList);
|
||||
// }
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
//无权限
|
||||
final List<int> token = reply.data.sublist(3, 7);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
@ -120,14 +133,15 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// 上传数据获取锁卡列表
|
||||
Future<void> _replyUpdataLockCardListReply(Reply reply) async {
|
||||
final int status = reply.data[2];
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final int dataLength = reply.data[8];
|
||||
state.uploadCardDataList.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if(dataLength == 10){
|
||||
state.uploadCardDataList
|
||||
.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if (dataLength == 10) {
|
||||
// 当数据是10的时候继续请求
|
||||
state.uploadCardPage = state.uploadCardPage + 1;
|
||||
|
||||
@ -135,7 +149,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
showEasyLoading();
|
||||
updataLockCardList(token, state.uploadCardPage);
|
||||
}else{
|
||||
} else {
|
||||
// // 当数据不是10的时候解析数据上传
|
||||
// if(state.uploadCardDataList.isEmpty){
|
||||
// // 如果是空的直接上传下一个
|
||||
@ -143,12 +157,13 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// }else{
|
||||
// // 如果不是空的解析数据上传
|
||||
state.indexCount.value = state.indexCount.value + 1;
|
||||
_lockDataUpload(uploadType:2, recordType:3, records:state.uploadCardDataList);
|
||||
_lockDataUpload(
|
||||
uploadType: 2, recordType: 3, records: state.uploadCardDataList);
|
||||
// }
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
//无权限
|
||||
final List<int> token = reply.data.sublist(3, 7);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
@ -167,14 +182,15 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// 上传数据获取锁指纹列表
|
||||
Future<void> _replyUpdataLockFingerprintListReply(Reply reply) async {
|
||||
final int status = reply.data[2];
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
//成功
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final int dataLength = reply.data[8];
|
||||
state.uploadFingerprintDataList.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if(dataLength == 10){
|
||||
state.uploadFingerprintDataList
|
||||
.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if (dataLength == 10) {
|
||||
// 当数据是10的时候继续请求
|
||||
state.uploadFingerprintPage = state.uploadFingerprintPage + 1;
|
||||
|
||||
@ -182,7 +198,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
showEasyLoading();
|
||||
updataLockFingerprintList(token, state.uploadFingerprintPage);
|
||||
}else{
|
||||
} else {
|
||||
// // 当数据不是10的时候解析数据上传
|
||||
// if(state.uploadFingerprintDataList.isEmpty){
|
||||
// // 如果是空的直接上传下一个
|
||||
@ -190,12 +206,15 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// }else{
|
||||
// // 如果不是空的解析数据上传
|
||||
state.indexCount.value = state.indexCount.value + 1;
|
||||
_lockDataUpload(uploadType:2, recordType:4, records:state.uploadFingerprintDataList);
|
||||
_lockDataUpload(
|
||||
uploadType: 2,
|
||||
recordType: 4,
|
||||
records: state.uploadFingerprintDataList);
|
||||
// }
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
//无权限
|
||||
final List<int> token = reply.data.sublist(3, 7);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
@ -214,14 +233,15 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// 上传数据获取锁人脸列表解析
|
||||
Future<void> _replyUpdataLockFaceListReply(Reply reply) async {
|
||||
final int status = reply.data[2];
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final int dataLength = reply.data[8];
|
||||
state.uploadFaceDataList.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if(dataLength == 10){
|
||||
state.uploadFaceDataList
|
||||
.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if (dataLength == 10) {
|
||||
// 当数据是10的时候继续请求
|
||||
state.uploadFacePage = state.uploadFacePage + 1;
|
||||
|
||||
@ -229,20 +249,21 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
showEasyLoading();
|
||||
updataLockFaceList(token, state.uploadFacePage);
|
||||
}else{
|
||||
} else {
|
||||
// // 当数据不是10的时候解析数据上传
|
||||
// if(state.uploadFaceDataList.isEmpty){
|
||||
// // 如果是空的直接上传下一个
|
||||
// getUpdataLockPalmVeinList();
|
||||
// }else{
|
||||
// 如果不是空的解析数据上传
|
||||
// 如果不是空的解析数据上传
|
||||
state.indexCount.value = state.indexCount.value + 1;
|
||||
_lockDataUpload(uploadType:2, recordType:5, records:state.uploadFaceDataList);
|
||||
_lockDataUpload(
|
||||
uploadType: 2, recordType: 5, records: state.uploadFaceDataList);
|
||||
// }
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
//无权限
|
||||
final List<int> token = reply.data.sublist(3, 7);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
@ -261,14 +282,15 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// 上传数据获取锁掌静脉列表解析
|
||||
Future<void> _replyUpdataLockPalmVeinListReply(Reply reply) async {
|
||||
final int status = reply.data[2];
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final int dataLength = reply.data[8];
|
||||
state.uploadPalmVeinDataList.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if(dataLength == 10){
|
||||
state.uploadPalmVeinDataList
|
||||
.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if (dataLength == 10) {
|
||||
// 当数据是10的时候继续请求
|
||||
state.uploadPalmVeinPage = state.uploadPalmVeinPage + 1;
|
||||
|
||||
@ -276,7 +298,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
showEasyLoading();
|
||||
updataLockPalmVeinList(token, state.uploadPalmVeinPage);
|
||||
}else{
|
||||
} else {
|
||||
// // 当数据不是10的时候解析数据上传
|
||||
// if(state.uploadPalmVeinDataList.isEmpty){
|
||||
// // 不需要上传 如果是空的直接上传下一个
|
||||
@ -284,12 +306,15 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// }else{
|
||||
// // 如果不是空的解析数据上传
|
||||
state.indexCount.value = state.indexCount.value + 1;
|
||||
_lockDataUpload(uploadType:2, recordType:6, records:state.uploadPalmVeinDataList);
|
||||
_lockDataUpload(
|
||||
uploadType: 2,
|
||||
recordType: 6,
|
||||
records: state.uploadPalmVeinDataList);
|
||||
// }
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
//无权限
|
||||
final List<int> token = reply.data.sublist(3, 7);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
@ -308,14 +333,15 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// 上传数据获取锁遥控列表解析
|
||||
Future<void> _replyUpdataLockRemoteControlListReply(Reply reply) async {
|
||||
final int status = reply.data[2];
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final int dataLength = reply.data[8];
|
||||
state.uploadRemoteControlDataList.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if(dataLength == 10){
|
||||
state.uploadRemoteControlDataList
|
||||
.addAll(reply.data.sublist(9, reply.data.length));
|
||||
if (dataLength == 10) {
|
||||
// 当数据是10的时候继续请求
|
||||
state.uploadRemoteControlPage = state.uploadRemoteControlPage + 1;
|
||||
|
||||
@ -323,7 +349,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
showEasyLoading();
|
||||
updataLockRemoteControlList(token, state.uploadRemoteControlPage);
|
||||
}else{
|
||||
} else {
|
||||
// // 当数据不是10的时候解析数据上传
|
||||
// if(state.uploadPalmVeinDataList.isEmpty){
|
||||
// // 不需要上传 如果是空的直接上传下一个
|
||||
@ -331,12 +357,15 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// }else{
|
||||
// // 如果不是空的解析数据上传
|
||||
state.indexCount.value = state.indexCount.value + 1;
|
||||
_lockDataUpload(uploadType:2, recordType:7, records:state.uploadRemoteControlDataList);
|
||||
_lockDataUpload(
|
||||
uploadType: 2,
|
||||
recordType: 7,
|
||||
records: state.uploadRemoteControlDataList);
|
||||
// }
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
//无权限
|
||||
final List<int> token = reply.data.sublist(3, 7);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
@ -355,17 +384,19 @@ class UploadDataLogic extends BaseGetXController{
|
||||
// 上传数据获取锁设置解析
|
||||
Future<void> _replyUpdataLockSetReply(Reply reply) async {
|
||||
final int status = reply.data[2];
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
state.indexCount.value = state.indexCount.value + 1;
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
state.uploadLockSetDataList.addAll(reply.data.sublist(7, reply.data.length));
|
||||
_lockDataUpload(uploadType:1, recordType:0, records:state.uploadLockSetDataList);
|
||||
state.uploadLockSetDataList
|
||||
.addAll(reply.data.sublist(7, reply.data.length));
|
||||
_lockDataUpload(
|
||||
uploadType: 1, recordType: 0, records: state.uploadLockSetDataList);
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
//无权限
|
||||
final List<int> token = reply.data.sublist(3, 7);
|
||||
final List<String> saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
@ -383,18 +414,19 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
// 上传数据获取锁密码列表
|
||||
Future<void> getUpdataLockPasswordList() async {
|
||||
if(state.sureBtnState.value == 1){
|
||||
if (state.sureBtnState.value == 1) {
|
||||
return;
|
||||
}
|
||||
state.sureBtnState.value = 1;
|
||||
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: (){
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
AppLog.log('上传密码列表获取超时 关闭加载菊花');
|
||||
state.sureBtnState.value = 0;
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
@ -405,7 +437,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
@ -414,7 +446,8 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
// 公共的获取密码列表
|
||||
Future<void> updataLockPasswordList(List<int> token, int page) async {
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
@ -428,19 +461,19 @@ class UploadDataLogic extends BaseGetXController{
|
||||
token: token,
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
privateKey: getPrivateKeyList);
|
||||
}
|
||||
|
||||
// 上传数据获取锁Card列表
|
||||
Future<void> getUpdataLockCardList() async {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: (){
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
state.indexCount.value = 0;
|
||||
state.sureBtnState.value = 0;
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
@ -451,7 +484,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
state.indexCount.value = 0;
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
@ -460,7 +493,8 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
// 公共的获取Card列表
|
||||
Future<void> updataLockCardList(List<int> token, int page) async {
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
@ -474,19 +508,19 @@ class UploadDataLogic extends BaseGetXController{
|
||||
token: token,
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
privateKey: getPrivateKeyList);
|
||||
}
|
||||
|
||||
// 上传数据获取锁指纹列表
|
||||
Future<void> getUpdataLockFingerprintList() async {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: (){
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
state.indexCount.value = 0;
|
||||
state.sureBtnState.value = 0;
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
@ -497,7 +531,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
state.indexCount.value = 0;
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
@ -506,7 +540,8 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
// 公共的获取指纹列表
|
||||
Future<void> updataLockFingerprintList(List<int> token, int page) async {
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
@ -520,19 +555,19 @@ class UploadDataLogic extends BaseGetXController{
|
||||
token: token,
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
privateKey: getPrivateKeyList);
|
||||
}
|
||||
|
||||
// 上传数据获取锁人脸列表
|
||||
Future<void> getUpdataLockFaceList() async {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: (){
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
state.indexCount.value = 0;
|
||||
state.sureBtnState.value = 0;
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
@ -543,7 +578,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
state.indexCount.value = 0;
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
@ -552,7 +587,8 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
// 公共的获取人脸列表
|
||||
Future<void> updataLockFaceList(List<int> token, int page) async {
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
@ -566,20 +602,19 @@ class UploadDataLogic extends BaseGetXController{
|
||||
token: token,
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
privateKey: getPrivateKeyList);
|
||||
}
|
||||
|
||||
|
||||
// 上传数据获取锁掌静脉列表
|
||||
Future<void> getUpdataLockPalmVeinList() async {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: (){
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
state.indexCount.value = 0;
|
||||
state.sureBtnState.value = 0;
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
@ -590,7 +625,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
state.indexCount.value = 0;
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
@ -599,7 +634,8 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
// 公共的获取掌静脉列表
|
||||
Future<void> updataLockPalmVeinList(List<int> token, int page) async {
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
@ -613,30 +649,31 @@ class UploadDataLogic extends BaseGetXController{
|
||||
token: token,
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
privateKey: getPrivateKeyList);
|
||||
}
|
||||
|
||||
// 上传数据获取锁遥控列表
|
||||
Future<void> getUpdataLockRemoteControlList() async {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: (){
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
state.indexCount.value = 0;
|
||||
state.sureBtnState.value = 0;
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
updataLockRemoteControlList(getTokenList, state.uploadRemoteControlPage);
|
||||
updataLockRemoteControlList(
|
||||
getTokenList, state.uploadRemoteControlPage);
|
||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
state.indexCount.value = 0;
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
@ -645,7 +682,8 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
// 公共的获取遥控列表
|
||||
Future<void> updataLockRemoteControlList(List<int> token, int page) async {
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
@ -659,19 +697,19 @@ class UploadDataLogic extends BaseGetXController{
|
||||
token: token,
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
privateKey: getPrivateKeyList);
|
||||
}
|
||||
|
||||
// 上传数据获取设置
|
||||
Future<void> getUpdataLockSet() async {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: (){
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
state.indexCount.value = 0;
|
||||
state.sureBtnState.value = 0;
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
@ -682,7 +720,7 @@ class UploadDataLogic extends BaseGetXController{
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
state.indexCount.value = 0;
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
@ -691,7 +729,8 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
// 公共的上传锁设置
|
||||
Future<void> updataLockSet(List<int> token) async {
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
@ -703,32 +742,29 @@ class UploadDataLogic extends BaseGetXController{
|
||||
token: token,
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
privateKey: getPrivateKeyList);
|
||||
}
|
||||
|
||||
// 锁数据上传服务器
|
||||
Future<void> _lockDataUpload({
|
||||
required int uploadType,
|
||||
required int recordType,
|
||||
required List records
|
||||
}) async{
|
||||
Future<void> _lockDataUpload(
|
||||
{required int uploadType,
|
||||
required int recordType,
|
||||
required List records}) async {
|
||||
final LoginEntity entity = await ApiRepository.to.lockDataUpload(
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId!,
|
||||
uploadType:uploadType,
|
||||
uploadType: uploadType,
|
||||
recordType: recordType,
|
||||
records:records,
|
||||
isUnShowLoading: false
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
if(uploadType == 1){
|
||||
records: records,
|
||||
isUnShowLoading: false);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (uploadType == 1) {
|
||||
// 1设置
|
||||
state.indexCount.value = 0;
|
||||
state.sureBtnState.value = 0;
|
||||
showToast('上传成功'.tr);
|
||||
}else{
|
||||
} else {
|
||||
// 2开门方式
|
||||
switch(recordType){
|
||||
switch (recordType) {
|
||||
// case 1:
|
||||
// // 电子钥匙
|
||||
//
|
||||
@ -761,13 +797,38 @@ class UploadDataLogic extends BaseGetXController{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
state.indexCount.value = 0;
|
||||
state.sureBtnState.value = 0;
|
||||
dismissEasyLoading();
|
||||
}
|
||||
}
|
||||
|
||||
// 上传数据成功后的回调
|
||||
void onUploadSuccess() {
|
||||
// 发送事件通知指纹列表刷新
|
||||
eventBus.fire(OtherTypeRefreshListEvent());
|
||||
// 返回上一页
|
||||
Get.back();
|
||||
}
|
||||
|
||||
// 在上传数据成功的地方调用
|
||||
Future<void> uploadData() async {
|
||||
try {
|
||||
// ... existing upload code ...
|
||||
|
||||
// 假设这是上传成功的标志
|
||||
bool uploadSuccess = true; // 这里需要根据实际的上传结果来设置
|
||||
|
||||
if (uploadSuccess) {
|
||||
onUploadSuccess();
|
||||
}
|
||||
} catch (e) {
|
||||
// 处理错误
|
||||
print('Upload failed: $e');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
@ -783,5 +844,4 @@ class UploadDataLogic extends BaseGetXController{
|
||||
|
||||
_replySubscription.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
set -e
|
||||
APP_PRODUCT_NAME=$APP_PRODUCT_NAME
|
||||
BUILD_STATUS=$1
|
||||
if [[ "${CI_COMMIT_BRANCH}" == "release" ]] ; then
|
||||
if [[ "${CI_COMMIT_BRANCH}" == "release_sky" ]] ; then
|
||||
WECAHT_WEBHOOK_URL=$PRE_QYWECAHT_WEBHOOK_URL
|
||||
SKY_IOS_DOWNLOAD_URL=$PRE_SKY_IOS_DOWNLOAD_URL
|
||||
SKY_ANDROID_DOWNLOAD_URL=$PRE_SKY_ANDROID_DOWNLOAD_URL
|
||||
XHJ_IOS_DOWNLOAD_URL=$PRE_XHJ_IOS_DOWNLOAD_URL
|
||||
XHJ_ANDROID_DOWNLOAD_URL=$PRE_XHJ_ANDROID_DOWNLOAD_URL
|
||||
elif [[ "${CI_COMMIT_BRANCH}" == "develop" ]] || [[ "${CI_COMMIT_BRANCH}" == "feat_devops" ]]; then
|
||||
elif [[ "${CI_COMMIT_BRANCH}" == "develop_sky" ]] || [[ "${CI_COMMIT_BRANCH}" == "feat_devops_sky" ]]; then
|
||||
WECAHT_WEBHOOK_URL=$DEV_QYWECAHT_WEBHOOK_URL
|
||||
SKY_IOS_DOWNLOAD_URL=$DEV_SKY_IOS_DOWNLOAD_URL
|
||||
SKY_ANDROID_DOWNLOAD_URL=$DEV_SKY_ANDROID_DOWNLOAD_URL
|
||||
|
||||
80
pubspec.lock
80
pubspec.lock
@ -24,30 +24,6 @@ packages:
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
amap_flutter_base:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: amap_flutter_base
|
||||
sha256: "9ef2439b8de7100cdd1b4357701b8ca8c059c0f2d9d0257b81750bbf0c6f53bb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
amap_flutter_location:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: amap_flutter_location
|
||||
sha256: f35ff00e196d579608e0bc28ccbc1f6f53787644702f947de941f775769cc701
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
amap_flutter_map:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: amap_flutter_map
|
||||
sha256: "9cebb0b2f5fc7d3ae0427e99c41edc883e8f5459f6a28bc850f0f9e16918cf2f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
app_settings:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -573,6 +549,14 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_app_badger:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_app_badger
|
||||
sha256: "64d4a279bab862ed28850431b9b446b9820aaae0bf363322d51077419f930fa8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
flutter_blue_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -788,30 +772,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
google_maps:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_maps
|
||||
sha256: "47eef3836b49bb030d5cb3afc60b8451408bf34cf753e571b645d6529eb4251a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.1.0"
|
||||
google_maps_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: google_maps_flutter
|
||||
sha256: c1972cbad779bc5346c49045f26ae45550a0958b1cbca5b524dd3c8954995d28
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.6.1"
|
||||
google_maps_flutter_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_maps_flutter_android
|
||||
sha256: "0bcadb80eba39afda77dede89a6caafd3b68f2786b90491eceea4a01c3db181c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.8.0"
|
||||
google_maps_flutter_ios:
|
||||
dependency: "direct overridden"
|
||||
description:
|
||||
@ -828,14 +788,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.9.5"
|
||||
google_maps_flutter_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_maps_flutter_web
|
||||
sha256: f3155c12119d8a5c2732fdf39ceb5cc095bc662059a03b4ea23294ecebe1d199
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.8"
|
||||
html:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -973,14 +925,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.7"
|
||||
js_wrapping:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js_wrapping
|
||||
sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.4"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1381,14 +1325,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.27.7"
|
||||
sanitize_html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sanitize_html
|
||||
sha256: "12669c4a913688a26555323fb9cec373d8f9fbe091f2d01c40c723b33caa8989"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
scrollable_positioned_list:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@ -1,63 +1,106 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 读取环境变量
|
||||
URL=$CI_API_V4_URL
|
||||
TOKEN=$GITLAB_ACCESS_TOKEN
|
||||
PROJECT_ID=$CI_PROJECT_ID
|
||||
next_tag=""
|
||||
newest_tag=""
|
||||
# ========================
|
||||
# tag_generator.sh
|
||||
# 用于自动识别并递增以 _sky 结尾的 tag(如 v1.5.556_sky),并生成下一个 tag。
|
||||
# 递增规则:feat: 提交递增 minor,fix: 或其他提交递增 patch。
|
||||
# ========================
|
||||
|
||||
# 读取环境变量(由 CI/CD 系统注入)
|
||||
URL=$CI_API_V4_URL # GitLab API v4 地址
|
||||
TOKEN=$GITLAB_ACCESS_TOKEN # GitLab 访问 Token
|
||||
PROJECT_ID=$CI_PROJECT_ID # 当前项目 ID
|
||||
next_tag="" # 新的 tag 变量
|
||||
newest_tag="" # 最新 tag 变量
|
||||
|
||||
echo "PRIVATE-TOKEN: $TOKEN $URL/projects/$PROJECT_ID/repository/tags"
|
||||
# 获取项目所有 tag 的 json 列表
|
||||
# 需要 jq 工具解析 json
|
||||
# tags_json 是所有 tag 的原始 json 数据
|
||||
tags_json=$(curl -H "Content-Type: application/json" -H "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/tags")
|
||||
#echo "tags_json:$tags_json\n"
|
||||
# 提取所有 tag 名称,按时间倒序排列(最新的在前)
|
||||
tags=$(echo "$tags_json" | jq -r '.[].name')
|
||||
tags_length=$(echo "$tags_json" | jq -r 'length')
|
||||
if [ "$tags_length" -lt 1 ]; then
|
||||
next_tag="v1.0.0"
|
||||
|
||||
# 只保留以 _sky 结尾的 tag(即只处理 v1.2.3_sky 这种格式的 tag)
|
||||
sky_tags=$(echo "$tags" | grep '_sky$')
|
||||
# 取最新的 _sky tag(即第一个)
|
||||
newest_sky_tag=$(echo "$sky_tags" | head -n 1)
|
||||
|
||||
# 如果没有 _sky 结尾的 tag,则从最新的 tag 提取版本号,生成 vX.Y.Z_sky
|
||||
if [ -z "$newest_sky_tag" ]; then
|
||||
# 取最新的 tag(不管是否带_sky)
|
||||
latest_tag=$(echo "$tags" | head -n 1)
|
||||
if [ -n "$latest_tag" ]; then
|
||||
# 提取版本号部分(去掉前缀v和后缀_sky等)
|
||||
version_part=${latest_tag#v} # 去掉v
|
||||
version_part=${version_part%_sky} # 去掉_sky(如果有)
|
||||
IFS='.' read -r major minor patch <<< "$version_part"
|
||||
next_tag="v$major.$minor.$patch_sky"
|
||||
else
|
||||
next_tag="v1.0.0_sky"
|
||||
fi
|
||||
else
|
||||
newest_tag=$(echo "$tags" | head -n 1)
|
||||
IFS='.' read -r major minor patch <<< "$newest_tag"
|
||||
major="${major#v}"
|
||||
compare_json=""
|
||||
# 解析版本号部分(去掉 _sky 后缀和 v 前缀)
|
||||
# 例如 v1.5.556_sky -> 1.5.556
|
||||
version_part=${newest_sky_tag%_sky} # 去掉 _sky 后缀
|
||||
version_part=${version_part#v} # 去掉 v 前缀
|
||||
IFS='.' read -r major minor patch <<< "$version_part" # 拆分出主、次、修订号
|
||||
compare_json="" # 用于存储 commit 对比结果
|
||||
# 判断命令参数,决定对比范围
|
||||
if [[ "$1" == "generate_tag" ]];then
|
||||
echo "generate_tag:$newest_tag-to-master\n"
|
||||
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$newest_tag&to=master")
|
||||
# 生成 tag 时,对比最新 _sky tag 和 master 之间的提交
|
||||
echo "generate_tag:$newest_sky_tag-to-master\n"
|
||||
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$newest_sky_tag&to=master")
|
||||
elif [[ "$1" == "generate_version" ]]; then
|
||||
echo "generate_version:master-to-$CI_COMMIT_BRANCH\n"
|
||||
# 生成版本号时,对比 master 和当前分支之间的提交
|
||||
echo "generate_version:master-to-$CI_COMMIT_BRANCH\n"
|
||||
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=master&to=$CI_COMMIT_BRANCH")
|
||||
fi
|
||||
echo "compare_json:$compare_json\n"
|
||||
new_patch=$patch
|
||||
new_minor=$minor
|
||||
new_patch=$patch # 新的 patch 号
|
||||
new_minor=$minor # 新的 minor 号
|
||||
# 遍历所有 commit,根据提交信息递增版本号
|
||||
while IFS= read -r commit_json; do
|
||||
# 使用 jq 解析每一行的 JSON 对象
|
||||
# 解析每个 commit 的 id 和 message
|
||||
commit_id=$(echo "$commit_json" | jq -r '.id')
|
||||
commit_message=$(echo "$commit_json" | jq -r '.message')
|
||||
echo "----$commit_message"
|
||||
# 如果有 feat: 类型提交,minor 递增(只递增一次)
|
||||
if [[ "$commit_message" =~ ("feat:"*) ]] && [[ $new_minor == $minor ]]; then
|
||||
((new_minor++))
|
||||
# new_patch=0
|
||||
# break
|
||||
# 如果有 fix: 类型提交,patch 递增
|
||||
elif [[ "$commit_message" =~ ("fix:"*) ]]; then
|
||||
((new_patch++))
|
||||
# 其他类型提交(非 Merge/Revert),patch 递增
|
||||
elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]]; then
|
||||
((new_patch++))
|
||||
fi
|
||||
done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}')
|
||||
next_tag="v$major.$new_minor.$new_patch"
|
||||
# 组装新的 tag,格式为 v<major>.<minor>.<patch>_sky
|
||||
next_tag="v$major.$new_minor.$new_patch_sky"
|
||||
fi
|
||||
echo "New Tag:$newest_tag;New version: $next_tag;command: $1"
|
||||
|
||||
echo "New Tag:$newest_sky_tag;New version: $next_tag;command: $1"
|
||||
|
||||
# 如果是 generate_tag 命令,且新 tag 和最新 tag 一致,则跳过生成
|
||||
if [[ "$1" == "generate_tag" ]];then
|
||||
if [ "$next_tag" == "$newest_tag" ]; then
|
||||
if [ "$next_tag" == "$newest_sky_tag" ]; then
|
||||
echo "no change from master,skip to generate tag"
|
||||
exit 0
|
||||
fi
|
||||
# 配置 git 用户名(可根据需要补充邮箱等)
|
||||
git config user.name
|
||||
# 创建并推送新 tag
|
||||
git tag $next_tag
|
||||
git push -u origin $next_tag
|
||||
echo "generate tag: $next_tag"
|
||||
elif [[ "$1" == "generate_version" ]]; then
|
||||
# 如果是 generate_version 命令,仅导出新版本号到环境变量
|
||||
export NEXT_VERSION="$next_tag"
|
||||
echo "generate version: $NEXT_VERSION"
|
||||
fi
|
||||
# 无论哪种情况,都把新 tag 写入 app_new.version 文件
|
||||
# 供后续流程使用
|
||||
|
||||
echo "$next_tag" > app_new.version
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user