Browse Source

记录用户本地app列表

master
nili 6 months ago
parent
commit
13e2357b8a
  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. 6
      game-service/src/main/java/awesome/group/game/service/bo/citrus/LocalApp.java
  4. 8
      game-service/src/main/java/awesome/group/game/service/citrus/UserService.java
  5. 13
      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

@ -27,5 +27,6 @@ public class MatrixUser {
private Long contributeIncome;//贡献给上级的收益,分,ecpm
private Integer env;//用户设备环境检测
private Integer status;//0正常,-1封禁
private String localApp;
private Timestamp createdAt;
}

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

@ -36,4 +36,7 @@ public interface MatrixUserMapper extends BaseMapper<MatrixUser> {
@Update("update matrix_user set status = #{status} where id = #{userId}")
int updateStatus(int userId, int status);
@Update("update matrix_user set local_app = #{str} where id = #{userId}")
int updateLocalApp(int userId, String str);
}

6
game-service/src/main/java/awesome/group/game/service/bo/citrus/LocalApp.java

@ -0,0 +1,6 @@
package awesome.group.game.service.bo.citrus;
public class LocalApp {
public String appName;
public String packageName;
}

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

@ -205,6 +205,14 @@ public class UserService {
userMapper.updateEnv(uid, env);
}
public void updateLocalApp(Integer uid, List<LocalApp> apps) {
if (CollectionUtils.isEmpty(apps)) {
return;
}
String str = gson.toJson(apps);
userMapper.updateLocalApp(uid, str);
}
public List<MatrixAdvRecordSimple> getAdvList(Integer userId, Integer lastId) {
if (lastId == null) {
lastId = Integer.MAX_VALUE;

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

@ -2,10 +2,7 @@ package awesome.group.game.web.rest.citrus;
import awesome.group.game.service.bo.MatrixAdvRecordEditBo;
import awesome.group.game.service.bo.MatrixAdvRecordSimple;
import awesome.group.game.service.bo.citrus.AdvResponse;
import awesome.group.game.service.bo.citrus.CashRecord;
import awesome.group.game.service.bo.citrus.TeamBo;
import awesome.group.game.service.bo.citrus.UserBo;
import awesome.group.game.service.bo.citrus.*;
import awesome.group.game.service.citrus.AdvRecordService;
import awesome.group.game.service.citrus.UserService;
import awesome.group.game.service.citrus.WeiXinService;
@ -91,4 +88,12 @@ public class UserController {
public R<List<MatrixAdvRecordSimple>> getAdvList(@RequestParam(required = false) Integer lastId) {
return new R<>(userService.getAdvList(RequestContext.getCitrusUid(), lastId));
}
@PostMapping("/updateLocalApp")
@RestApi
public R<Void> updateLocalApp(@RequestBody List<LocalApp> apps) {
userService.updateLocalApp(RequestContext.getCitrusUid(), apps);
return new R<>(null);
}
}

Loading…
Cancel
Save