尼玛,隔行如隔山。

.Net真操蛋。

        /// <summary>
/// 加入群
/// </summary>
/// <returns></returns>
[HttpPost]
public ActionResult AgreeJoinGroup(string appType, int applyerId,int groupId)
{
var group = _groupService.GetGroupById(groupId);
// 判断群是否存在
if (null == group)
{
return Json(new { result = false, msg = "群不存在" });
} // 判断群是否解散
if (group.IsDismiss)
{
return Json(new { result = false, msg = "群已解散" });
} // 判断用户是否已经在群中
bool isInGroup = _groupMemberService.CheckMemberInGroup(groupId, applyerId);
if (isInGroup)
{
return Json(new { result = false, msg = "已是群成员" });
} // 加入群中
GroupMember member = new GroupMember()
{
GroupId = groupId,
CustomerId = applyerId,
CreatedOn = DateTime.Now,
LastUpdateOn = DateTime.Now,
IsGag = false,
IsQuit = false
};
_groupMemberService.InsertGroupMember(member); return Json(new { result = true, msg = "操作成功" });
}

这个接口算是比较清晰的了。思路清晰了,代码才能清晰,否则就是一团乱麻,剪不断,理还乱。

最新文章

  1. Objective-C开发编码规范【转载】
  2. ios视图frame和bounds的对比
  3. bdb log file 预设长度的性能优化
  4. Netty学习四:Channel
  5. LOB字段存放在指定表空间 清理CLOB字段及压缩CLOB空间
  6. Google Code Jam 2009, Round 1C C. Bribe the Prisoners (记忆化dp)
  7. Apache OFBiz
  8. CentOS 6.3中安装OpenCV2.3.1
  9. 用N2N搭建简单的VPN
  10. transfer-webpack-plugin最简使用示例
  11. 【转】简单理解Vue中的nextTick
  12. 【MYSQL】MYSQL报错解决方法: Warning: (3719, &quot;&#39;utf8&#39; is currently an alias for the character set UTF8MB3, but will be an alias for UTF8M B4 in a future release.&quot;
  13. MySql cmd下的学习笔记 —— 有关视图的操作(建立表)
  14. Linux Bash Shell字符串分割substring等(转)
  15. sublime插件安装及常用插件配置
  16. typedef那回事儿
  17. js 不固定传参
  18. 洛谷 P1503 鬼子进村 解题报告
  19. python注解(装饰器)的用法
  20. DNA Pairing-freecodecamp算法题目

热门文章

  1. SVN在vs2013中使用
  2. PostgreSQL Replication之第三章 理解即时恢复(1)
  3. 事件代理(event的target属性)
  4. Linux 中常用的基础命令一
  5. 使用GitHub+Hexo建立个人网站,并绑定自己的域名(Ubuntu环境下)
  6. 紫书 例题 10-9 UVa 1636 (概率计算)
  7. 用JS中的cookie实现商品的浏览记录
  8. python中的类与继承
  9. SharePoint创建Alternate Access Mapping (AAM)备用訪问映射
  10. SQL Server数据全同步及价值分析[终结版]