mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-28 22:58:10 +08:00
feat: cron task
This commit is contained in:
parent
2f13149555
commit
2e439508bc
@ -15,16 +15,11 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/openimsdk/open-im-server/v3/internal/tools"
|
|
||||||
"github.com/openimsdk/tools/system/program"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MsgUtilsCmd struct {
|
type MsgUtilsCmd struct {
|
||||||
cobra.Command
|
cobra.Command
|
||||||
MsgTool *tools.MsgTool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MsgUtilsCmd) AddUserIDFlag() {
|
func (m *MsgUtilsCmd) AddUserIDFlag() {
|
||||||
@ -146,27 +141,7 @@ func NewSeqCmd() *SeqCmd {
|
|||||||
|
|
||||||
func (s *SeqCmd) GetSeqCmd() *cobra.Command {
|
func (s *SeqCmd) GetSeqCmd() *cobra.Command {
|
||||||
s.Command.Run = func(cmdLines *cobra.Command, args []string) {
|
s.Command.Run = func(cmdLines *cobra.Command, args []string) {
|
||||||
_, err := tools.InitMsgTool(context.Background(), nil)
|
|
||||||
if err != nil {
|
|
||||||
program.ExitWithError(err)
|
|
||||||
}
|
|
||||||
userID := s.getUserIDFlag(cmdLines)
|
|
||||||
superGroupID := s.getSuperGroupIDFlag(cmdLines)
|
|
||||||
// beginSeq := s.getBeginSeqFlag(cmdLines)
|
|
||||||
// limit := s.getLimitFlag(cmdLines)
|
|
||||||
if userID != "" {
|
|
||||||
// seq, err := msgTool.s(context.Background(), userID)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
// println(seq)
|
|
||||||
} else if superGroupID != "" {
|
|
||||||
// seq, err := msgTool.GetSuperGroupSeq(context.Background(), superGroupID)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
// println(seq)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return &s.Command
|
return &s.Command
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user