|
|
|
@ -1,10 +1,6 @@ |
|
|
|
|
package com.community.pocket.api.android; |
|
|
|
|
|
|
|
|
|
import com.community.pocket.entity.po.Forum; |
|
|
|
|
import com.community.pocket.entity.po.ForumContent; |
|
|
|
|
import com.community.pocket.entity.po.android.Active; |
|
|
|
|
import com.community.pocket.entity.po.android.Complain; |
|
|
|
|
import com.community.pocket.entity.po.android.Score; |
|
|
|
|
import com.community.pocket.entity.po.android.Token; |
|
|
|
|
import com.community.pocket.entity.vo.ForumQuery; |
|
|
|
|
import com.community.pocket.entity.vo.Page; |
|
|
|
@ -71,9 +67,7 @@ public class ForumController { |
|
|
|
|
public ForumPostResponse ok(ActiveVo activeVo) { |
|
|
|
|
Forum forum = forumDao.save(activeVo); |
|
|
|
|
if (forum != null) { |
|
|
|
|
ForumContent forumContent = forumContentDao.save(activeVo, forum); |
|
|
|
|
Active active = activeDao.save(activeVo, forum); |
|
|
|
|
if (forumContent != null && active != null) { |
|
|
|
|
if (forumContentDao.save(activeVo, forum) != null && activeDao.save(activeVo, forum) != null && userDao.updatePosts(activeVo)) { |
|
|
|
|
return new ForumPostResponse(Result.OK, ForumPostResponse.Msg.ok); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -95,8 +89,7 @@ public class ForumController { |
|
|
|
|
public ForumPostResponse ok(ForumVo forumVo) { |
|
|
|
|
Forum forum = forumDao.save(forumVo); |
|
|
|
|
if (forum != null) { |
|
|
|
|
ForumContent forumContent = forumContentDao.save(forumVo, forum); |
|
|
|
|
if (forumContent != null) { |
|
|
|
|
if (forumContentDao.save(forumVo, forum) != null && userDao.updatePosts(forumVo)) { |
|
|
|
|
return new ForumPostResponse(Result.OK, ForumPostResponse.Msg.ok); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -117,12 +110,10 @@ public class ForumController { |
|
|
|
|
@Override |
|
|
|
|
public ForumPostResponse ok(ForumScoreVo forumVo) { |
|
|
|
|
Forum forum = forumDao.save(forumVo); |
|
|
|
|
if (forum != null) { |
|
|
|
|
ForumContent forumContent = forumContentDao.save(forumVo, forum); |
|
|
|
|
Score score = scoreDao.save(scoreVo, forum); |
|
|
|
|
if (forumContent != null && score != null) { |
|
|
|
|
return new ForumPostResponse(Result.OK, ForumPostResponse.Msg.ok); |
|
|
|
|
} |
|
|
|
|
if (forum != null && |
|
|
|
|
forumContentDao.save(forumVo, forum) != null && |
|
|
|
|
scoreDao.save(scoreVo, forum) != null && userDao.updatePosts(forumVo)) { |
|
|
|
|
return new ForumPostResponse(Result.OK, ForumPostResponse.Msg.ok); |
|
|
|
|
} |
|
|
|
|
return new ForumPostResponse(Result.FAIL, ForumPostResponse.Msg.fail); |
|
|
|
|
} |
|
|
|
@ -142,9 +133,7 @@ public class ForumController { |
|
|
|
|
public ForumPostResponse ok(ComplainVo complainVo) { |
|
|
|
|
Forum forum = forumDao.save(complainVo); |
|
|
|
|
if (forum != null) { |
|
|
|
|
ForumContent forumContent = forumContentDao.save(complainVo, forum); |
|
|
|
|
Complain complain = complainDao.save(complainVo, forum); |
|
|
|
|
if (forumContent != null && complain != null) { |
|
|
|
|
if (forumContentDao.save(complainVo, forum) != null && complainDao.save(complainVo, forum) != null && userDao.updatePosts(complainVo)) { |
|
|
|
|
return new ForumPostResponse(Result.OK, ForumPostResponse.Msg.ok); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|