点赞和不能重复点赞

    @RequestMapping("/addCount")
    public Object addCount(String id) {
        
        Query query = new Query();
        query.addCriteria(Criteria.where("_id").is(id));
        Update update = new Update();
        update.inc("count",10);
        mongoTemplate.updateFirst(query, update, CommentDao.class);
        return "成功";
        
        
    }

猜你喜欢

转载自www.cnblogs.com/zwyzwy/p/11976867.html
今日推荐