feat: 开始计划web管理
This commit is contained in:
parent
f0744edbe8
commit
b990d7856f
|
@ -30,6 +30,12 @@ type Config struct {
|
||||||
ChatID int64 `json:"chat_id" yaml:"chat_id"`
|
ChatID int64 `json:"chat_id" yaml:"chat_id"`
|
||||||
Proxy string `json:"proxy" yaml:"proxy"`
|
Proxy string `json:"proxy" yaml:"proxy"`
|
||||||
} `json:"tg" yaml:"tg"`
|
} `json:"tg" yaml:"tg"`
|
||||||
|
Web struct {
|
||||||
|
Account string `json:"account"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
Host string `json:"host"`
|
||||||
|
Port int `json:"port"`
|
||||||
|
} `json:"web"`
|
||||||
Cron string `json:"cron"`
|
Cron string `json:"cron"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +48,11 @@ var (
|
||||||
//go:embed config_default.yml
|
//go:embed config_default.yml
|
||||||
var defaultConfig []byte
|
var defaultConfig []byte
|
||||||
|
|
||||||
|
// GetConfig
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @return Config
|
||||||
|
*/
|
||||||
func GetConfig() Config {
|
func GetConfig() Config {
|
||||||
file, err := os.ReadFile("./config/config.yml")
|
file, err := os.ReadFile("./config/config.yml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
10
lib/score.go
10
lib/score.go
|
@ -11,14 +11,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Score struct {
|
type Score struct {
|
||||||
TotalScore int
|
TotalScore int `json:"total_score"`
|
||||||
TodayScore int
|
TodayScore int `json:"today_score"`
|
||||||
Content map[string]Data
|
Content map[string]Data `json:"content"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Data struct {
|
type Data struct {
|
||||||
CurrentScore int
|
CurrentScore int `json:"current_score"`
|
||||||
MaxScore int
|
MaxScore int `json:"max_score"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUserScore(cookies []Cookie) (Score, error) {
|
func GetUserScore(cookies []Cookie) (Score, error) {
|
||||||
|
|
|
@ -313,8 +313,8 @@ func study(bot *Telegram, args []string) {
|
||||||
defer datas.Delete(u)
|
defer datas.Delete(u)
|
||||||
core.Init()
|
core.Init()
|
||||||
defer core.Quit()
|
defer core.Quit()
|
||||||
core.LearnArticle(cookies)
|
go core.LearnArticle(cookies)
|
||||||
core.LearnVideo(cookies)
|
go core.LearnVideo(cookies)
|
||||||
WaitStudy(&User{Cookies: cookies})
|
WaitStudy(&User{Cookies: cookies})
|
||||||
core.RespondDaily(cookies, "daily")
|
core.RespondDaily(cookies, "daily")
|
||||||
core.RespondDaily(cookies, "weekly")
|
core.RespondDaily(cookies, "weekly")
|
||||||
|
|
Loading…
Reference in New Issue