Esempio n. 1
0
  @Override
  public boolean movePosition(Cond cond) {
    cond.buildMoveRecommendPositionCond();
    long qid1 = cond.getQid()[0];
    long qid2 = cond.getQid()[1];

    if (qid1 > 0 && qid2 > 0 && qid1 != qid2) {
      Recommendation recommendation1 = questionRepository.buildRecommendation(qid1);
      Recommendation recommendation2 = questionRepository.buildRecommendation(qid2);
      questionRepository.moveRecommendPosition(recommendation1, recommendation2);
    }
    return true;
  }
Esempio n. 2
0
  @Override
  public boolean removeRecommend(Cond cond) {
    cond.buildRemoveRecommendCond();
    for (long qid : cond.getQid()) {
      if (qid <= 0) {
        continue;
      }
      RecommendTransient rt = new RecommendTransient();
      rt.setQid(qid);

      questionRepository.removeRecommend(questionRepository.buildRecommendation(rt));
    }
    return true;
  }
Esempio n. 3
0
  @Override
  public boolean addRecommend(Cond cond) {
    cond.buildAddRecommendCond();
    for (long qid : cond.getQid()) {
      if (qid <= 0) {
        continue;
      }
      RecommendTransient rt = new RecommendTransient();
      rt.setQid(qid);
      rt.setRecommendTime(cond.getRecommendTime());
      rt.setUserid(cond.getOperatorid());

      questionRepository.addRecommend(questionRepository.buildRecommendation(rt));
    }
    return true;
  }
Esempio n. 4
0
 @Override
 public List<Question> getQARWaitList(Cond cond) {
   cond.buildQAWaitRCond();
   return questionRepository.listWaitQARecommend(cond);
 }
Esempio n. 5
0
 // public QARecommendImpl(QuestionRepository
 // questionRepository,UserRepository userRepository) {
 // this.questionRepository = questionRepository;
 // this.userRepository = userRepository;
 // }
 @Override
 public List<Recommendation> getQARList(Cond cond) {
   cond.buildRecommendCond();
   return questionRepository.listQARecommend(cond);
 }