|
|
@ -1,14 +1,20 @@ |
|
|
|
package awesome.group.game.service.citrus; |
|
|
|
|
|
|
|
import awesome.group.game.dao.bean.MatrixAdvRecord; |
|
|
|
import awesome.group.game.dao.bean.MatrixApp; |
|
|
|
import awesome.group.game.dao.bean.MatrixMoneyRecord; |
|
|
|
import awesome.group.game.dao.bean.MatrixUser; |
|
|
|
import awesome.group.game.dao.mapper.MatrixAdvRecordMapper; |
|
|
|
import awesome.group.game.dao.mapper.MatrixAppMapper; |
|
|
|
import awesome.group.game.dao.mapper.MatrixMoneyRecordMapper; |
|
|
|
import awesome.group.game.dao.mapper.MatrixUserMapper; |
|
|
|
import awesome.group.game.service.SmsService; |
|
|
|
import awesome.group.game.service.UMengService; |
|
|
|
import awesome.group.game.service.bo.citrus.*; |
|
|
|
import awesome.group.game.service.bo.MatrixAdvRecordSimple; |
|
|
|
import awesome.group.game.service.bo.citrus.CashRecord; |
|
|
|
import awesome.group.game.service.bo.citrus.LoginReq; |
|
|
|
import awesome.group.game.service.bo.citrus.TeamBo; |
|
|
|
import awesome.group.game.service.bo.citrus.UserBo; |
|
|
|
import awesome.group.game.service.bo.matrix.AppNormalConfig; |
|
|
|
import awesome.group.game.service.bo.matrix.UmengConfigBo; |
|
|
|
import awesome.group.game.service.common.exception.PaganiException; |
|
|
@ -53,6 +59,9 @@ public class UserService { |
|
|
|
@Autowired |
|
|
|
private UMengService uMengService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private MatrixAdvRecordMapper advRecordMapper; |
|
|
|
|
|
|
|
public static final int STATUS_WAITING = 0;//等审核
|
|
|
|
|
|
|
|
public static final int STATUS_AUDIT_PASS = 1;//已审核通过
|
|
|
@ -103,7 +112,7 @@ public class UserService { |
|
|
|
UmengConfigBo configBo = gson.fromJson(app.getUmeng(), UmengConfigBo.class); |
|
|
|
String mobile = uMengService.getMobile(token, configBo); |
|
|
|
MatrixUser user = userMapper.selectByAppIdAndMobile(app.getId(), mobile); |
|
|
|
if(user != null && user.getStatus() == Constants.USER_BANNED) { |
|
|
|
if (user != null && user.getStatus() == Constants.USER_BANNED) { |
|
|
|
throw new PaganiException(PaganiExceptionCode.GENERAL_ERROR, "账号异常,无法登录"); |
|
|
|
} |
|
|
|
MatrixUser upUser = null; |
|
|
@ -164,6 +173,19 @@ public class UserService { |
|
|
|
userMapper.updateEnv(uid, env); |
|
|
|
} |
|
|
|
|
|
|
|
public List<MatrixAdvRecordSimple> getAdvList(Integer userId, Integer lastId) { |
|
|
|
if (lastId == null) { |
|
|
|
lastId = Integer.MAX_VALUE; |
|
|
|
} |
|
|
|
LambdaQueryWrapper<MatrixAdvRecord> query = Wrappers.lambdaQuery(); |
|
|
|
query.eq(MatrixAdvRecord::getUserId, userId); |
|
|
|
query.lt(MatrixAdvRecord::getId, lastId); |
|
|
|
query.eq(MatrixAdvRecord::getAdvType, Constants.VIDEO); |
|
|
|
query.last("limit 20"); |
|
|
|
List<MatrixAdvRecord> data = advRecordMapper.selectList(query); |
|
|
|
return data.stream().map(MatrixAdvRecordSimple::new).toList(); |
|
|
|
} |
|
|
|
|
|
|
|
public void applyMoney(Integer uid, Integer cent) { |
|
|
|
Assert.isTrue(cent >= 10, "至少提0.1元"); |
|
|
|
MatrixUser u = userMapper.selectById(uid); |
|
|
|