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