nili
1 year ago
7 changed files with 89 additions and 7 deletions
@ -1,15 +1,24 @@ |
|||||
package awesome.group.game.dao.mapper; |
package awesome.group.game.dao.mapper; |
||||
|
|
||||
import awesome.group.game.dao.bean.WeGameUser; |
import awesome.group.game.dao.bean.WeGameUser; |
||||
|
import awesome.group.game.dao.bean.WxUserInfo; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Param; |
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.Update; |
import org.apache.ibatis.annotations.Update; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
public interface WeGameUserMapper extends BaseMapper<WeGameUser> { |
public interface WeGameUserMapper extends BaseMapper<WeGameUser> { |
||||
@Select("select * from we_game_user where app_id = #{appId} and open_id = #{openId}") |
@Select("select * from we_game_user where app_id = #{appId} and open_id = #{openId}") |
||||
WeGameUser query(@Param("appId")String appId, @Param("openId")String openId); |
WeGameUser query(@Param("appId")String appId, @Param("openId")String openId); |
||||
|
|
||||
@Update("update we_game_user set session_key = #{sessionKey} where id = #{id}") |
@Update("update we_game_user set session_key = #{sessionKey} where id = #{id}") |
||||
int updateSessionKey(@Param("sessionKey")String sessionKey, @Param("id")Integer id); |
int updateSessionKey(@Param("sessionKey")String sessionKey, @Param("id")Integer id); |
||||
|
|
||||
|
@Update("update we_game_user set score = #{score} where id = #{id}") |
||||
|
int updateScore(@Param("score")Integer score, @Param("id")Integer id); |
||||
|
|
||||
|
@Select("select * from we_game_user where app_id = #{appId} order by score desc limit #{size}") |
||||
|
List<WeGameUser> queryTop(@Param("appId")String appId, @Param("size")Integer size); |
||||
} |
} |
||||
|
@ -0,0 +1,15 @@ |
|||||
|
package awesome.group.game.service.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class RankList { |
||||
|
public List<UserInfo> list; |
||||
|
public String myRank; |
||||
|
public Integer myScore; |
||||
|
|
||||
|
public String myAvatarUrl; |
||||
|
public String myNickName; |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package awesome.group.game.service.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class UserInfo { |
||||
|
public String avatarUrl; |
||||
|
public String nickName; |
||||
|
public Integer score; |
||||
|
} |
Loading…
Reference in new issue