mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 21:02:11 +08:00
refactor: cmd update.
This commit is contained in:
parent
2ac3ff5801
commit
4c30f333f8
@ -14,44 +14,47 @@
|
|||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/openimsdk/open-im-server/v3/pkg/common/cmd"
|
||||||
|
"github.com/openimsdk/tools/system/program"
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ch := make(chan int)
|
msgUtilsCmd := cmd.NewMsgUtilsCmd("openIMCmdUtils", "openIM cmd utils", nil)
|
||||||
<-ch
|
getCmd := cmd.NewGetCmd()
|
||||||
//msgUtilsCmd := cmd.NewMsgUtilsCmd("openIMCmdUtils", "openIM cmd utils", nil)
|
fixCmd := cmd.NewFixCmd()
|
||||||
//getCmd := cmd.NewGetCmd()
|
clearCmd := cmd.NewClearCmd()
|
||||||
//fixCmd := cmd.NewFixCmd()
|
seqCmd := cmd.NewSeqCmd()
|
||||||
//clearCmd := cmd.NewClearCmd()
|
msgCmd := cmd.NewMsgCmd()
|
||||||
//seqCmd := cmd.NewSeqCmd()
|
getCmd.AddCommand(seqCmd.GetSeqCmd(), msgCmd.GetMsgCmd())
|
||||||
//msgCmd := cmd.NewMsgCmd()
|
getCmd.AddSuperGroupIDFlag()
|
||||||
//getCmd.AddCommand(seqCmd.GetSeqCmd(), msgCmd.GetMsgCmd())
|
getCmd.AddUserIDFlag()
|
||||||
//getCmd.AddSuperGroupIDFlag()
|
getCmd.AddBeginSeqFlag()
|
||||||
//getCmd.AddUserIDFlag()
|
getCmd.AddLimitFlag()
|
||||||
//getCmd.AddBeginSeqFlag()
|
// openIM get seq --userID=xxx
|
||||||
//getCmd.AddLimitFlag()
|
// openIM get seq --superGroupID=xxx
|
||||||
//// openIM get seq --userID=xxx
|
// openIM get msg --userID=xxx --beginSeq=100 --limit=10
|
||||||
//// openIM get seq --superGroupID=xxx
|
// openIM get msg --superGroupID=xxx --beginSeq=100 --limit=10
|
||||||
//// openIM get msg --userID=xxx --beginSeq=100 --limit=10
|
|
||||||
//// openIM get msg --superGroupID=xxx --beginSeq=100 --limit=10
|
fixCmd.AddCommand(seqCmd.FixSeqCmd())
|
||||||
//
|
fixCmd.AddSuperGroupIDFlag()
|
||||||
//fixCmd.AddCommand(seqCmd.FixSeqCmd())
|
fixCmd.AddUserIDFlag()
|
||||||
//fixCmd.AddSuperGroupIDFlag()
|
fixCmd.AddFixAllFlag()
|
||||||
//fixCmd.AddUserIDFlag()
|
// openIM fix seq --userID=xxx
|
||||||
//fixCmd.AddFixAllFlag()
|
// openIM fix seq --superGroupID=xxx
|
||||||
//// openIM fix seq --userID=xxx
|
// openIM fix seq --fixAll
|
||||||
//// openIM fix seq --superGroupID=xxx
|
|
||||||
//// openIM fix seq --fixAll
|
clearCmd.AddCommand(msgCmd.ClearMsgCmd())
|
||||||
//
|
clearCmd.AddSuperGroupIDFlag()
|
||||||
//clearCmd.AddCommand(msgCmd.ClearMsgCmd())
|
clearCmd.AddUserIDFlag()
|
||||||
//clearCmd.AddSuperGroupIDFlag()
|
clearCmd.AddClearAllFlag()
|
||||||
//clearCmd.AddUserIDFlag()
|
clearCmd.AddBeginSeqFlag()
|
||||||
//clearCmd.AddClearAllFlag()
|
clearCmd.AddLimitFlag()
|
||||||
//clearCmd.AddBeginSeqFlag()
|
// openIM clear msg --userID=xxx --beginSeq=100 --limit=10
|
||||||
//clearCmd.AddLimitFlag()
|
// openIM clear msg --superGroupID=xxx --beginSeq=100 --limit=10
|
||||||
//// openIM clear msg --userID=xxx --beginSeq=100 --limit=10
|
// openIM clear msg --clearAll
|
||||||
//// openIM clear msg --superGroupID=xxx --beginSeq=100 --limit=10
|
msgUtilsCmd.AddCommand(&getCmd.Command, &fixCmd.Command, &clearCmd.Command)
|
||||||
//// openIM clear msg --clearAll
|
if err := msgUtilsCmd.Execute(); err != nil {
|
||||||
//msgUtilsCmd.AddCommand(&getCmd.Command, &fixCmd.Command, &clearCmd.Command)
|
program.ExitWithError(err)
|
||||||
//if err := msgUtilsCmd.Execute(); err != nil {
|
}
|
||||||
// program.ExitWithError(err)
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,8 +39,7 @@ type CronTaskConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Start(ctx context.Context, config *CronTaskConfig) error {
|
func Start(ctx context.Context, config *CronTaskConfig) error {
|
||||||
ch := make(chan int)
|
|
||||||
<-ch
|
|
||||||
log.CInfo(ctx, "CRON-TASK server is initializing", "chatRecordsClearTime",
|
log.CInfo(ctx, "CRON-TASK server is initializing", "chatRecordsClearTime",
|
||||||
config.CronTask.ChatRecordsClearTime, "msgDestructTime", config.CronTask.MsgDestructTime)
|
config.CronTask.ChatRecordsClearTime, "msgDestructTime", config.CronTask.MsgDestructTime)
|
||||||
|
|
||||||
|
|||||||
@ -55,6 +55,8 @@ func NewMsgTool(msgDatabase controller.CommonMsgDatabase, userDatabase controlle
|
|||||||
}
|
}
|
||||||
|
|
||||||
func InitMsgTool(ctx context.Context, config *CronTaskConfig) (*MsgTool, error) {
|
func InitMsgTool(ctx context.Context, config *CronTaskConfig) (*MsgTool, error) {
|
||||||
|
ch := make(chan int)
|
||||||
|
<-ch
|
||||||
//mgocli, err := mongoutil.NewMongoDB(ctx, config.MongodbConfig.Build())
|
//mgocli, err := mongoutil.NewMongoDB(ctx, config.MongodbConfig.Build())
|
||||||
//if err != nil {
|
//if err != nil {
|
||||||
// return nil, err
|
// return nil, err
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user