|
@@ -65,6 +65,8 @@ func (l *CreateWxLogic) CreateWx(req *types.WxInfo) (*types.BaseMsgResp, error)
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
+ var stringSlice []string
|
|
|
+
|
|
|
if ent.IsNotFound(err) {
|
|
|
wxid := strconv.Itoa(rand.New(rand.NewSource(time.Now().UnixNano())).Intn(1000000))
|
|
|
_, err := l.svcCtx.DB.Wx.Create().
|
|
@@ -76,6 +78,10 @@ func (l *CreateWxLogic) CreateWx(req *types.WxInfo) (*types.BaseMsgResp, error)
|
|
|
SetNotNilAPIKey(req.ApiKey).
|
|
|
SetWxid(wxid).
|
|
|
SetStatus(0).
|
|
|
+ SetAllowList(stringSlice).
|
|
|
+ SetGroupAllowList(stringSlice).
|
|
|
+ SetBlockList(stringSlice).
|
|
|
+ SetGroupBlockList(stringSlice).
|
|
|
Save(l.ctx)
|
|
|
if err != nil {
|
|
|
return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|