Example #1
0
 public IActionResult Add(TopicModel model)
 {
     var topic = PuppyBBS.Services.EMapper.Mapper<TopicModel, Services.Models.Topic>(model);
     topic.TID = Services.Util.SnowFlake.CreateId();
     topic.UID = Convert.ToInt64(User.FindFirst(ClaimTypes.NameIdentifier).Value);
     var obj = AppServices.Insert(topic);
     return Json(new JsonModel { status = 0, msg = "发布成功", action = "/topic/detail/" + topic.TID.ToString() });
 }