public IHttpActionResult MyVotes([FromBody] RankPost post) { try { voteService = new VoteService(); return(Ok()); } catch (Exception ex) { log.Error(ex); return(InternalServerError(ex)); } }
public IHttpActionResult GetRank([FromBody] RankPost rankBody) { try { userService = new WxUserService(); if (string.IsNullOrEmpty(rankBody.tid)) { throw new ArgumentNullException("tid"); } List <TopicRank> rank = Cache.GetCache <List <TopicRank> >("topicRank"); if (rank == null) { rank = userService.GetTopicInviteRank(rankBody.tid, rankBody.uid); Cache.WriteCache("topicRank", rank, DateTime.Now.AddMinutes(5)); } return(Ok(rank)); } catch (Exception ex) { log.Error(ex); return(InternalServerError(ex)); } }