Skip to content

规则引擎aviatorscript原型 #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bravf opened this issue Oct 22, 2024 · 0 comments
Open

规则引擎aviatorscript原型 #17

bravf opened this issue Oct 22, 2024 · 0 comments

Comments

@bravf
Copy link
Owner

bravf commented Oct 22, 2024

##### 标准库
sys = seq.map()

## 输出对象,最终返回给java
sys.out_data = seq.map('is_hit',false, 'money',0 ,'log', '')

## 打印日志
sys.log = fn(&logs) {
  for log in logs{
    sys.out_data.log = sys.out_data.log + log + '\n'
  }
}

## 增加输出项
sys.output = fn(key,value) {
  sys.out_data[key] = value
}

## 设置规则是否命中
sys.hit = fn(is_hit) {
  sys.out_data.is_hit = is_hit
}

## 设置质控金额
sys.set_money = fn(money) {
  sys.out_data.money = money
}

## case1
sys.log('nihao');
sys.hit(true);
sys.set_money(100);
sys.output('test','test');
return sys.out_data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant