Browse Source

用户设备环境标记

master
nili 5 months ago
parent
commit
db0915603a
  1. 1
      game-dao/src/main/java/awesome/group/game/dao/bean/MatrixUser.java
  2. 3
      game-dao/src/main/java/awesome/group/game/dao/mapper/MatrixUserMapper.java
  3. 4
      game-service/src/main/java/awesome/group/game/service/citrus/UserService.java
  4. 8
      game-web/src/main/java/awesome/group/game/web/rest/citrus/UserController.java

1
game-dao/src/main/java/awesome/group/game/dao/bean/MatrixUser.java

@ -24,5 +24,6 @@ public class MatrixUser {
private Integer upUid; private Integer upUid;
private Long income;//分,累计收益 private Long income;//分,累计收益
private Long contributeIncome;//贡献给上级的收益,分,ecpm private Long contributeIncome;//贡献给上级的收益,分,ecpm
private Integer env;//用户设备环境检测
private Timestamp createdAt; private Timestamp createdAt;
} }

3
game-dao/src/main/java/awesome/group/game/dao/mapper/MatrixUserMapper.java

@ -27,4 +27,7 @@ public interface MatrixUserMapper extends BaseMapper<MatrixUser> {
@Update("update matrix_user set wx_open_id = #{wxOpenId}, nickname = #{nickname}, avatar = #{avatar} where id = #{userId}") @Update("update matrix_user set wx_open_id = #{wxOpenId}, nickname = #{nickname}, avatar = #{avatar} where id = #{userId}")
int updateWx(String wxOpenId, String nickname, String avatar, int userId); int updateWx(String wxOpenId, String nickname, String avatar, int userId);
@Update("update matrix_user set env = #{env} where id = #{userId}")
int updateEnv(int userId, int env);
} }

4
game-service/src/main/java/awesome/group/game/service/citrus/UserService.java

@ -155,6 +155,10 @@ public class UserService {
return res; return res;
} }
public void updateEnv(Integer uid, Integer env) {
userMapper.updateEnv(uid, env);
}
public void applyMoney(Integer uid, Integer cent) { public void applyMoney(Integer uid, Integer cent) {
Assert.isTrue(cent >= 10, "至少提0.1元"); Assert.isTrue(cent >= 10, "至少提0.1元");
MatrixUser u = userMapper.selectById(uid); MatrixUser u = userMapper.selectById(uid);

8
game-web/src/main/java/awesome/group/game/web/rest/citrus/UserController.java

@ -12,6 +12,7 @@ import awesome.group.game.service.common.response.R;
import awesome.group.game.web.RequestContext; import awesome.group.game.web.RequestContext;
import awesome.group.game.web.aop.RestApi; import awesome.group.game.web.aop.RestApi;
import io.swagger.v3.oas.annotations.Hidden; import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -77,4 +78,11 @@ public class UserController {
public R<TeamBo> myTeam() { public R<TeamBo> myTeam() {
return new R<>(userService.myTeam(RequestContext.getCitrusUid())); return new R<>(userService.myTeam(RequestContext.getCitrusUid()));
} }
@PostMapping("/updateEnv")
@RestApi
public R<Void> updateEnv(@RequestParam Integer env) {
userService.updateEnv(RequestContext.getCitrusUid(), env);
return new R<>(null);
}
} }

Loading…
Cancel
Save