作者 唐旭辉

修复 bug

@@ -44,16 +44,16 @@ func (command CreatePartnerInfoCommand) ValidateCommand() error { @@ -44,16 +44,16 @@ func (command CreatePartnerInfoCommand) ValidateCommand() error {
44 if command.RegionInfo == nil { 44 if command.RegionInfo == nil {
45 return lib.ThrowError(lib.ARG_ERROR, "区域必填") 45 return lib.ThrowError(lib.ARG_ERROR, "区域必填")
46 } 46 }
47 - if len(command.Salesman) == 0 {  
48 - return lib.ThrowError(lib.ARG_ERROR, "关联业务员必填")  
49 - }  
50 - for i := range command.Salesman {  
51 - if len(command.Salesman[i].Name) == 0 {  
52 - return lib.ThrowError(lib.ARG_ERROR, "关联业务员名称必填")  
53 - }  
54 - if len(command.Salesman[i].Telephone) == 0 {  
55 - return lib.ThrowError(lib.ARG_ERROR, "关联业务员电话必填")  
56 - }  
57 - } 47 + // if len(command.Salesman) == 0 {
  48 + // return lib.ThrowError(lib.ARG_ERROR, "关联业务员必填")
  49 + // }
  50 + // for i := range command.Salesman {
  51 + // if len(command.Salesman[i].Name) == 0 {
  52 + // return lib.ThrowError(lib.ARG_ERROR, "关联业务员名称必填")
  53 + // }
  54 + // if len(command.Salesman[i].Telephone) == 0 {
  55 + // return lib.ThrowError(lib.ARG_ERROR, "关联业务员电话必填")
  56 + // }
  57 + // }
58 return nil 58 return nil
59 } 59 }
@@ -31,19 +31,20 @@ func (command *UpdatePartnerInfoCommand) ValidateCommand() error { @@ -31,19 +31,20 @@ func (command *UpdatePartnerInfoCommand) ValidateCommand() error {
31 if command.RegionInfo == nil { 31 if command.RegionInfo == nil {
32 return lib.ThrowError(lib.ARG_ERROR, "区域必填") 32 return lib.ThrowError(lib.ARG_ERROR, "区域必填")
33 } 33 }
34 - if len(command.Salesman) == 0 {  
35 - return lib.ThrowError(lib.ARG_ERROR, "关联业务员必填")  
36 - } 34 +
37 if command.Id == 0 { 35 if command.Id == 0 {
38 return lib.ThrowError(lib.ARG_ERROR, "合伙人id错误") 36 return lib.ThrowError(lib.ARG_ERROR, "合伙人id错误")
39 } 37 }
40 - for i := range command.Salesman {  
41 - if len(command.Salesman[i].Name) == 0 {  
42 - return lib.ThrowError(lib.ARG_ERROR, "关联业务员名称必填")  
43 - }  
44 - if len(command.Salesman[i].Telephone) == 0 {  
45 - return lib.ThrowError(lib.ARG_ERROR, "关联业务员电话必填")  
46 - }  
47 - } 38 + // if len(command.Salesman) == 0 {
  39 + // return lib.ThrowError(lib.ARG_ERROR, "关联业务员必填")
  40 + // }
  41 + // for i := range command.Salesman {
  42 + // if len(command.Salesman[i].Name) == 0 {
  43 + // return lib.ThrowError(lib.ARG_ERROR, "关联业务员名称必填")
  44 + // }
  45 + // if len(command.Salesman[i].Telephone) == 0 {
  46 + // return lib.ThrowError(lib.ARG_ERROR, "关联业务员电话必填")
  47 + // }
  48 + // }
48 return nil 49 return nil
49 } 50 }
@@ -55,14 +55,14 @@ func (c *MessageConsumer) ConsumeClaim(groupSession sarama.ConsumerGroupSession, @@ -55,14 +55,14 @@ func (c *MessageConsumer) ConsumeClaim(groupSession sarama.ConsumerGroupSession,
55 for message := range groupClaim.Messages() { 55 for message := range groupClaim.Messages() {
56 logs.Debug("Done Message claimed: timestamp = %v, topic = %s offset = %v value = %v \n", 56 logs.Debug("Done Message claimed: timestamp = %v, topic = %s offset = %v value = %v \n",
57 message.Timestamp, message.Topic, message.Offset, string(message.Value)) 57 message.Timestamp, message.Topic, message.Offset, string(message.Value))
  58 + groupSession.MarkMessage(message, "")
58 if topicHandle, err = c.FindTopichandle(groupClaim.Topic()); err != nil { 59 if topicHandle, err = c.FindTopichandle(groupClaim.Topic()); err != nil {
59 logs.Error("FindTopichandle err:%s \n", err) 60 logs.Error("FindTopichandle err:%s \n", err)
  61 +
60 continue 62 continue
61 } 63 }
62 if err = topicHandle(message); err != nil { 64 if err = topicHandle(message); err != nil {
63 logs.Error("Message claimed: kafka消息处理错误 topic =", message.Topic, message.Offset, err) 65 logs.Error("Message claimed: kafka消息处理错误 topic =", message.Topic, message.Offset, err)
64 - } else {  
65 - groupSession.MarkMessage(message, "")  
66 } 66 }
67 } 67 }
68 return nil 68 return nil