From aa450620d3aec43194ca3a78709b95091d965916 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Mon, 16 Aug 2021 17:35:27 +0800 Subject: [PATCH] x --- conf/config.yaml | 14 ++++++++++++++ models/config.go | 20 +------------------- models/container.go | 19 +++++++++++++++++++ models/task.go | 13 +++++++++++++ 4 files changed, 47 insertions(+), 19 deletions(-) diff --git a/conf/config.yaml b/conf/config.yaml index 7ea249e..009bc19 100755 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -21,3 +21,17 @@ qqgid: default_priority: no_ghproxy: true daily_asset_push_cron: +task: + - cron: 0 6 * * * + path: https://raw.githubusercontent.com/cdle/xdd/main/scripts/jd_goodMorning.js + enable: true + word: 早起打卡 + mode: obo + - cron: 0 0 * * * + path: https://raw.githubusercontent.com/cdle/xdd/main/scripts/jd_angryBean.js + enable: true + word: 抢京豆 + mode: alo + env: + - name: angryBeanPins + - value: jd_xxxxx&jd_ooooo diff --git a/models/config.go b/models/config.go index 59a59b2..184b159 100644 --- a/models/config.go +++ b/models/config.go @@ -1,7 +1,6 @@ package models import ( - "bufio" "io" "io/ioutil" "os" @@ -11,26 +10,9 @@ import ( "gopkg.in/yaml.v2" ) -type Container struct { - Type string - Name string - Default bool - Address string - Username string - Password string - Path string - Version string - Token string - Available bool - Delete []string - Weigth int - Mode string - Reader *bufio.Reader - Config string - Limit int -} type Yaml struct { Containers []Container + Tasks []Task Qrcode string Master string Mode string diff --git a/models/container.go b/models/container.go index e001e77..cb3fb0d 100644 --- a/models/container.go +++ b/models/container.go @@ -22,6 +22,25 @@ const ( LI = "li" ) +type Container struct { + Type string + Name string + Default bool + Address string + Username string + Password string + Path string + Version string + Token string + Available bool + Delete []string + Weigth int + Mode string + Reader *bufio.Reader + Config string + Limit int +} + func initContainer() { for i := range Config.Containers { if Config.Containers[i].Weigth == 0 { diff --git a/models/task.go b/models/task.go index 2640e7f..c201125 100644 --- a/models/task.go +++ b/models/task.go @@ -1 +1,14 @@ package models + +type Task struct { + Cron string + Path string + Enable bool + Mode string //obo alo + Word string +} + +type Env struct { + Name string + Value string +}