任务附件参数

This commit is contained in:
meixiongfeng 2023-03-14 14:42:06 +08:00
parent a16fdaf150
commit a97c348986
2 changed files with 34 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import (
"go_dreamfactory/lego" "go_dreamfactory/lego"
"go_dreamfactory/lego/base/rpcx" "go_dreamfactory/lego/base/rpcx"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/cron"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules/equipment" "go_dreamfactory/modules/equipment"
"go_dreamfactory/modules/hero" "go_dreamfactory/modules/hero"
@ -26,7 +27,9 @@ import (
"time" "time"
"github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo/options"
flag "github.com/spf13/pflag" flag "github.com/spf13/pflag"
) )
@ -71,8 +74,35 @@ func GetMonthStartEnd() (int64, int64) {
fmt.Printf("%d,%d", _d1, _d2) fmt.Printf("%d,%d", _d1, _d2)
return _d1, _d2 return _d1, _d2
} }
func Test_Main(t *testing.T) { func TimerStar() {
//star := configure.Now()
if !db.IsCross() {
conn, err := db.Cross()
if err == nil {
model := db.NewDBModel(comm.TableSeasonData, 0, conn)
model.DB.DeleteMany(comm.TableSeasonPagoda, bson.M{}, options.Delete())
model.DB.DeleteMany(comm.TableSeasonRecord, bson.M{}, options.Delete())
for pos := 0; pos < comm.MaxRankNum; pos++ {
key1 := fmt.Sprintf("pagodaList%d", pos)
if err := model.Redis.Delete(key1); err != nil {
log.Errorf("delete failed")
}
}
if err := model.Redis.Delete("pagodaSeasonRank"); err != nil {
log.Errorf("delete failed")
}
}
// DB.DeleteMany(comm.TableSeasonRecord, bson.M{}, options.Delete())
}
//this.module.Debugf("=====%d,", time.Since(star).Milliseconds())
}
func Test_Main(t *testing.T) {
cron.AddFunc("0 0 5 /* * ?", TimerStar) //每月第一天5点执行一次
sz := make([]string, 0) sz := make([]string, 0)
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
sz = append(sz, "1") sz = append(sz, "1")

View File

@ -96,9 +96,9 @@ func (this *Hero) createRepeatHero(session comm.IUserSession, heroCfgId string,
cfg := this.configure.GetHeroConfig(heroCfgId) cfg := this.configure.GetHeroConfig(heroCfgId)
if cfg != nil { if cfg != nil {
var szTask []*comm.TaskParam var szTask []*comm.TaskParam
szTask = append(szTask, comm.GettaskParam(comm.Rtype1, utils.ToInt32(heroCfgId))) szTask = append(szTask, comm.GettaskParam(comm.Rtype1, 1, utils.ToInt32(heroCfgId)))
szTask = append(szTask, comm.GettaskParam(comm.Rtype30, cfg.Color)) szTask = append(szTask, comm.GettaskParam(comm.Rtype30, 1, cfg.Color))
szTask = append(szTask, comm.GettaskParam(comm.Rtype31, cfg.Color)) szTask = append(szTask, comm.GettaskParam(comm.Rtype31, 1, cfg.Color))
go this.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) go this.ModuleRtask.TriggerTask(session.GetUserId(), szTask...)
} }