forked from erp-dev/erp
feat: error_code + api doc + printing-job fields
This commit is contained in:
22
api_v1/management/commands/set_app_version.py
Normal file
22
api_v1/management/commands/set_app_version.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from flower.app_version import set_cached_app_version_payload
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "更新 App 最新版本信息缓存"
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument("--major", type=int, required=True)
|
||||
parser.add_argument("--minor", type=int, required=True)
|
||||
parser.add_argument("--build", type=int, required=True)
|
||||
parser.add_argument("--download-url", required=True)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
payload = set_cached_app_version_payload(
|
||||
major=options["major"],
|
||||
minor=options["minor"],
|
||||
build=options["build"],
|
||||
download_url=options["download_url"],
|
||||
)
|
||||
self.stdout.write(self.style.SUCCESS(str(payload)))
|
||||
@@ -8,7 +8,15 @@ class Command(BaseCommand):
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('--limit', type=int, default=100)
|
||||
parser.add_argument(
|
||||
'--no-advance-cursor',
|
||||
action='store_true',
|
||||
help='只拉取并同步本批 records,不推进外部 cursor。适合本地/测试环境检查。',
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
payload = sync_external_printing_records.run(limit=options['limit'])
|
||||
payload = sync_external_printing_records.run(
|
||||
limit=options['limit'],
|
||||
advance_cursor=not options['no_advance_cursor'],
|
||||
)
|
||||
self.stdout.write(self.style.SUCCESS(str(payload)))
|
||||
|
||||
Reference in New Issue
Block a user