|
|
@ -22,7 +22,6 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
type MsgUtilsCmd struct {
|
|
|
|
type MsgUtilsCmd struct {
|
|
|
|
cobra.Command
|
|
|
|
cobra.Command
|
|
|
|
msgTool *tools.MsgTool
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgUtilsCmd) AddUserIDFlag() {
|
|
|
|
func (m *MsgUtilsCmd) AddUserIDFlag() {
|
|
|
@ -38,19 +37,19 @@ func (m *MsgUtilsCmd) AddFixAllFlag() {
|
|
|
|
m.Command.PersistentFlags().BoolP("fixAll", "f", false, "openIM fix all seqs")
|
|
|
|
m.Command.PersistentFlags().BoolP("fixAll", "f", false, "openIM fix all seqs")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgUtilsCmd) getFixAllFlag(cmdLines *cobra.Command) bool {
|
|
|
|
/* func (m *MsgUtilsCmd) getFixAllFlag(cmdLines *cobra.Command) bool {
|
|
|
|
fixAll, _ := cmdLines.Flags().GetBool("fixAll")
|
|
|
|
fixAll, _ := cmdLines.Flags().GetBool("fixAll")
|
|
|
|
return fixAll
|
|
|
|
return fixAll
|
|
|
|
}
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgUtilsCmd) AddClearAllFlag() {
|
|
|
|
func (m *MsgUtilsCmd) AddClearAllFlag() {
|
|
|
|
m.Command.PersistentFlags().BoolP("clearAll", "c", false, "openIM clear all seqs")
|
|
|
|
m.Command.PersistentFlags().BoolP("clearAll", "c", false, "openIM clear all seqs")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgUtilsCmd) getClearAllFlag(cmdLines *cobra.Command) bool {
|
|
|
|
/* func (m *MsgUtilsCmd) getClearAllFlag(cmdLines *cobra.Command) bool {
|
|
|
|
clearAll, _ := cmdLines.Flags().GetBool("clearAll")
|
|
|
|
clearAll, _ := cmdLines.Flags().GetBool("clearAll")
|
|
|
|
return clearAll
|
|
|
|
return clearAll
|
|
|
|
}
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgUtilsCmd) AddSuperGroupIDFlag() {
|
|
|
|
func (m *MsgUtilsCmd) AddSuperGroupIDFlag() {
|
|
|
|
m.Command.PersistentFlags().StringP("superGroupID", "g", "", "openIM superGroupID")
|
|
|
|
m.Command.PersistentFlags().StringP("superGroupID", "g", "", "openIM superGroupID")
|
|
|
@ -65,19 +64,19 @@ func (m *MsgUtilsCmd) AddBeginSeqFlag() {
|
|
|
|
m.Command.PersistentFlags().Int64P("beginSeq", "b", 0, "openIM beginSeq")
|
|
|
|
m.Command.PersistentFlags().Int64P("beginSeq", "b", 0, "openIM beginSeq")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgUtilsCmd) getBeginSeqFlag(cmdLines *cobra.Command) int64 {
|
|
|
|
/* func (m *MsgUtilsCmd) getBeginSeqFlag(cmdLines *cobra.Command) int64 {
|
|
|
|
beginSeq, _ := cmdLines.Flags().GetInt64("beginSeq")
|
|
|
|
beginSeq, _ := cmdLines.Flags().GetInt64("beginSeq")
|
|
|
|
return beginSeq
|
|
|
|
return beginSeq
|
|
|
|
}
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgUtilsCmd) AddLimitFlag() {
|
|
|
|
func (m *MsgUtilsCmd) AddLimitFlag() {
|
|
|
|
m.Command.PersistentFlags().Int64P("limit", "l", 0, "openIM limit")
|
|
|
|
m.Command.PersistentFlags().Int64P("limit", "l", 0, "openIM limit")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgUtilsCmd) getLimitFlag(cmdLines *cobra.Command) int64 {
|
|
|
|
/* func (m *MsgUtilsCmd) getLimitFlag(cmdLines *cobra.Command) int64 {
|
|
|
|
limit, _ := cmdLines.Flags().GetInt64("limit")
|
|
|
|
limit, _ := cmdLines.Flags().GetInt64("limit")
|
|
|
|
return limit
|
|
|
|
return limit
|
|
|
|
}
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
func (m *MsgUtilsCmd) Execute() error {
|
|
|
|
func (m *MsgUtilsCmd) Execute() error {
|
|
|
|
return m.Command.Execute()
|
|
|
|
return m.Command.Execute()
|
|
|
@ -134,6 +133,7 @@ func NewSeqCmd() *SeqCmd {
|
|
|
|
return seqCmd
|
|
|
|
return 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()
|
|
|
|
_, err := tools.InitMsgTool()
|
|
|
|