当前位置: 首页 > news >正文

怎么宣传自己的网站推广外链提交网站

怎么宣传自己的网站推广,外链提交网站,壹壹推广联盟,seo网络推广培训班案例实战之SortedSet⽤户积分实时榜单最佳实践 背景 ⽤户玩游戏-积分实时榜单 IT视频热销实时榜单 电商商品热销实时榜单 ⼀般的排⾏榜读多写少#xff0c;可以对 master 进⾏写⼊操作#xff0c;然后多个 slave 进⾏读取操作。如果是对象记得重写HashCode与Equals⽅法 User…案例实战之SortedSet⽤户积分实时榜单最佳实践 背景 ⽤户玩游戏-积分实时榜单 IT视频热销实时榜单 电商商品热销实时榜单 ⼀般的排⾏榜读多写少可以对 master 进⾏写⼊操作然后多个 slave 进⾏读取操作。如果是对象记得重写HashCode与Equals⽅法 UserPointVO package net.xdclass.xdclassredis.vo;import java.util.Objects;public class UserPointVO {public UserPointVO(String username, String phone) {this.username username;this.phone phone;}private String username;private String phone;public String getUsername() {return username;}public void setUsername(String username) {this.username username;}public String getPhone() {return phone;}public void setPhone(String phone) {this.phone phone;}Overridepublic boolean equals(Object o) {if (this o) return true;if (o null || getClass() ! o.getClass()) return false;UserPointVO that (UserPointVO) o;return Objects.equals(phone, that.phone);}Overridepublic int hashCode() {return Objects.hash(phone);} } 加入测试数据 SpringBootTest class XdclassRedisApplicationTests {Autowiredprivate RedisTemplate redisTemplate;Testvoid testData() {UserPointVO p1 new UserPointVO(老王,13113);UserPointVO p2 new UserPointVO(老A,324);UserPointVO p3 new UserPointVO(老B,242);UserPointVO p4 new UserPointVO(老C,542345);UserPointVO p5 new UserPointVO(老D,235);UserPointVO p6 new UserPointVO(老E,1245);UserPointVO p7 new UserPointVO(老F,2356432);UserPointVO p8 new UserPointVO(老G,532332);BoundZSetOperationsString, UserPointVO operations redisTemplate.boundZSetOps(point:rank:real);operations.add(p1,324);operations.add(p2,542);operations.add(p3,52);operations.add(p4,434);operations.add(p5,1123);operations.add(p6,64);operations.add(p7,765);operations.add(p8,8);} } 接⼝开发 返回榜单-从⼤到⼩排序 查看这个⼈的排名,从⼤到⼩0就是第⼀ 给某个⽤户加积分 查看某个⽤户的积分 import net.xdclass.xdclassredis.model.VideoDO; import net.xdclass.xdclassredis.util.JsonData; import net.xdclass.xdclassredis.vo.UserPointVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.BoundZSetOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;import java.util.List; import java.util.Set;RestController RequestMapping(api/v1/rank) public class RankController {Autowiredprivate RedisTemplate redisTemplate;private static final String DAILY_RANK_KEY video:rank:daily;/*** 返回全部榜单从大到小* return*/RequestMapping(real_rank1)public JsonData realRank1() {BoundZSetOperationsString, UserPointVO operations redisTemplate.boundZSetOps(point:rank:real);SetUserPointVO set operations.reverseRange(0, -1);return JsonData.buildSuccess(set);}/*** 返回全部榜单从小到大* return*/RequestMapping(real_rank2)public JsonData realRank2() {BoundZSetOperationsString, UserPointVO operations redisTemplate.boundZSetOps(point:rank:real);SetUserPointVO set operations.range(0, -1);return JsonData.buildSuccess(set);}/*** 返回全部榜单从大到小,指定长度* return*/RequestMapping(real_rank3)public JsonData realRank3() {BoundZSetOperationsString, UserPointVO operations redisTemplate.boundZSetOps(point:rank:real);SetUserPointVO set operations.reverseRange(0, 3);return JsonData.buildSuccess(set);}/*** 查看某个用户的排名* param phone* param name* return*/RequestMapping(find_myrank)public JsonData realMyRank(String phone,String name) {BoundZSetOperationsString, UserPointVO operations redisTemplate.boundZSetOps(point:rank:real);UserPointVO userPointVO new UserPointVO(name,phone);long rank operations.reverseRank(userPointVO);return JsonData.buildSuccess(rank);}/*** 加积分* param phone* param name* return*/RequestMapping(uprank)public JsonData uprank(String phone,String name,int point) {BoundZSetOperationsString, UserPointVO operations redisTemplate.boundZSetOps(point:rank:real);UserPointVO userPointVO new UserPointVO(name,phone);operations.incrementScore(userPointVO,point);SetUserPointVO set operations.range(0, -1);return JsonData.buildSuccess(set);}/*** 查看个人的积分* param phone* param name* return*/RequestMapping(mypoint)public JsonData mypoint(String phone,String name) {BoundZSetOperationsString, UserPointVO operations redisTemplate.boundZSetOps(point:rank:real);UserPointVO userPointVO new UserPointVO(name,phone);double score operations.score(userPointVO);return JsonData.buildSuccess(score);}}
http://www.zqtcl.cn/news/465299/

相关文章:

  • 做视频网站怎么备案最新网站架构
  • 黄金网站app软件下载安装免费淘宝网页版登录
  • 幸运28网站建设网站返回指定位置怎么做
  • 建设个直播网站要多少钱兴业大街网站建设
  • 网站设计培训班创业上海今天新闻发布会直播
  • 电商网站制作设计wordpress jquery 无法
  • 关键词优化易下拉效率北京和隆优化科技
  • 漯河企业网站开发天津建设协会网站
  • wap网站模式房产信息查询网
  • 做外贸怎么进入国外的网站百度指数总结
  • ui设计作品网站东莞做网站的网络公司
  • 网站未备案怎么访问做网站图片教程
  • 温州专业营销网站建设网络建设解决方案
  • 滨州网站建设 远洋科技网站需求建设书
  • 知道网站域名怎么联系域名解析不成功是什么意思
  • 武宁网站ui专业设计wordpress评论通知代码6
  • thymeleaf做网站 seo重庆平台网站建设找哪家
  • WordPress子站站群建筑工程网上申请质量安全监督
  • 怎么给网站添加图标山西手机版建站系统哪家好
  • frontpage网页制作视频教程昆明网站建设优化企业
  • 工信部 诚信网站备案公司网络营销方案
  • 网站开发采集工具如何做网站内链优化
  • 在线做英语题的网站揭阳建站服务
  • 网站非法篡改wordpress的知名网站
  • 保定网建站模板uv推广平台
  • 股权分配系统建设网站wordpress mip 模板
  • 网站及其建设的心得体会昆明云南微网站
  • 详情页在线设计网站推荐广州建设网站企业
  • 设计师网站建设哪家网络公司做网站
  • 宣城网站开发专业制注册资金写100万后悔