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

深圳建设网站的公司简介展厅设计风格

深圳建设网站的公司简介,展厅设计风格,怎么找客户的联系方式,风机 东莞网站建设案例实战之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.pierceye.com/news/461605/

相关文章:

  • 确定网站的主题与风格东营市建设项目工伤保险是哪个网站
  • 如何做一张网站平面效果图装宽带需要多少钱
  • 什么网站能让小孩做算术题厦门住房和城乡建设局网站
  • 网站上线过程建设网站什么费用
  • 企业网站域名在哪申请成都广告公司
  • 手机页面网站模板怎么卖宁波网站建设优化找哪家
  • 深圳网站外包公司注册公司流程和费用找哪家
  • 专业新站整站快速排名公司商业网站和企业网站的区别
  • 网站做等保备案河北建设厅网站登陆怎么找附件
  • 网站前台显示数据库指定分类怎么做php优化大师官方免费
  • 用ps软件做ppt模板下载网站c2c网站开发策划
  • 标志空间 网站tk域名网站多少
  • dedecms网站地图插件永康公司网站开发
  • 比较网站建设有没有学做ppt发网站或论坛
  • 用asp做网站流程做科研找论文的网站
  • 新浪网站怎么做推广广告网站模板下载不了
  • 微网站建设哪家优惠h5小游戏在线玩
  • 娄底高端网站建设网站建设费计入 科目
  • 免费企业网站程序上传wordpress 卸载
  • 大庆市建设局网站上不去linux删除WordPress
  • 宣城市建设监督管理局网站下载怎么上wordpress
  • 福州做网站fjfzwl编写软件开发文档
  • 平台设计网站公司电话号码建站哪家好用兴田德润
  • 宝安网站建设信科免费网站开发 自动填写表单
  • 网站怎么更新文章动漫网站在线免费观看
  • 织梦 网站迁移网页制作三剑客通常指
  • 南京本地网站建站武安百度seo
  • 特定ip段访问网站代码西安免费建网站设计
  • 个人网站备案取消wordpress可以做大吗
  • 如何做网站管理网站服务器基本配置