1 Star 1 Fork 0

a07061625 / swooleyaf_install

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
helper_component.py 886 Bytes
一键复制 编辑 原始数据 按行查看 历史
紫血剑神 提交于 2021-04-03 18:28 . a000-feat(component): add notify
# -*- coding:utf-8 -*-
import click
from jcomponent.db.ComponentMysql import *
from jcomponent.notify.DingTalk import *
def get_version(ctx, param, value):
if not value or ctx.resilient_parsing:
return
click.echo('组件管理脚本')
click.echo('Version: 1.1')
click.echo('Author: 姜伟')
click.echo('公共依赖: click')
ctx.exit()
@click.group()
@click.option('-v', '--version', is_flag=True, callback=get_version, expose_value=False, is_eager=True)
def main():
pass
@main.command()
def mysql_inception():
"""审计Mysql"""
ComponentMysql.inception({})
@main.command()
@click.option('--file', required=True, type=str, help="通知内容文件")
def notify_dingtalk_robot(file):
"""钉钉机器人通知"""
params = {
'msg_file': file
}
DingTalk.send_robot(params)
if __name__ == '__main__':
main()
Python
1
https://gitee.com/a07061625/swooleyaf_install.git
git@gitee.com:a07061625/swooleyaf_install.git
a07061625
swooleyaf_install
swooleyaf_install
master

搜索帮助