public ResultNormal SendComment(InArtComment indata) { NLogHelper.InfoTxt($"[SendComment]unionId: {indata.unionId}"); ResultNormal result = new ResultNormal(); try { var checkRes = WXApi.CheckContentSec(indata.Content); if (checkRes.errcode == 0) { EArtComment artComment = new EArtComment { ArtId = indata.ArtId, Content = indata.Content, Praize = 0, UnionId = indata.unionId, CreateDateTime = DateTime.Now, RefId = 0, }; _WxMiniSrv.AddComment(artComment); var artInfo = _WxMiniSrv.GetArtInfo(indata.ArtId); artInfo.Comments++; _WxMiniSrv.SaveChanges(); } else { if (checkRes.errcode == 87014) { result.ErrorMsg = "请注意您的言论,请勿发布包含色情、违法等有害信息"; } else { result.ErrorMsg = checkRes.errMsg; } } } catch (Exception ex) { result.ErrorMsg = "发布评论失败"; } return(result); }