|
@@ -57,21 +57,21 @@ func (s *AutoreplyServ) GetAutoReplyById(autoReplyId string) (*model.TaAutoReply
|
57
|
57
|
func (s *AutoreplyServ) SaveAutoReply(autoreply model.TaAutoReply, orgId string) (*model.TaAutoReply, error) {
|
58
|
58
|
var newAutoreply *model.TaAutoReply
|
59
|
59
|
var err error
|
60
|
|
- if autoreply.RuleName == "" {
|
61
|
|
- return nil, errors.New("规则名不能为空")
|
62
|
|
- }
|
63
|
|
- if autoreply.AutoType == models.AUTOREPLY_KEYWORDS && autoreply.Keywords == "" {
|
64
|
|
- return nil, errors.New("关键词不能为空")
|
65
|
|
- }
|
66
|
|
- if autoreply.PairType == "" {
|
67
|
|
- return nil, errors.New("匹配规则不能为空")
|
68
|
|
- }
|
69
|
|
- if autoreply.MessageType == models.MESSAGE_TYPE_CONTENT && autoreply.MessageContent == "" {
|
70
|
|
- return nil, errors.New("图文不能为空")
|
71
|
|
- }
|
72
|
|
- if autoreply.MessageType == models.MESSAGE_TYPE_IMG && autoreply.MessageImg == "" {
|
73
|
|
- return nil, errors.New("图片不能为空")
|
74
|
|
- }
|
|
60
|
+ // if autoreply.RuleName == "" {
|
|
61
|
+ // return nil, errors.New("规则名不能为空")
|
|
62
|
+ // }
|
|
63
|
+ // if autoreply.AutoType == models.AUTOREPLY_KEYWORDS && autoreply.Keywords == "" {
|
|
64
|
+ // return nil, errors.New("关键词不能为空")
|
|
65
|
+ // }
|
|
66
|
+ // if autoreply.PairType == "" {
|
|
67
|
+ // return nil, errors.New("匹配规则不能为空")
|
|
68
|
+ // }
|
|
69
|
+ // if autoreply.MessageType == models.MESSAGE_TYPE_CONTENT && autoreply.MessageContent == "" {
|
|
70
|
+ // return nil, errors.New("图文不能为空")
|
|
71
|
+ // }
|
|
72
|
+ // if autoreply.MessageType == models.MESSAGE_TYPE_IMG && autoreply.MessageImg == "" {
|
|
73
|
+ // return nil, errors.New("图片不能为空")
|
|
74
|
+ // }
|
75
|
75
|
if autoreply.AutoReplyId == "" {
|
76
|
76
|
autoreply.OrgId = orgId
|
77
|
77
|
newAutoreply, err = s.dao.AddAutoReply(autoreply)
|