今天接受了一个捕鱼的源码,技术栈采用:
- 客户端:Unity
- 服务端:Java
- 数据库:mysql
- 缓存:redis
先来几张成品图
在代码中看到有腾讯推广渠道,这套不管是代码质量还是游戏画质都是非常不错的。而且不关有捕鱼还有拉霸类型的游戏。cdk兑换实物兑换商城等功能。
package com.maple.game.osee.controller.gm;
import com.maple.database.config.redis.RedisHelper;
import com.maple.database.data.entity.UserEntity;
import com.maple.database.data.mapper.UserMapper;
import com.maple.engine.anotation.GmController;
import com.maple.engine.anotation.GmHandler;
import com.maple.engine.utils.JsonMapUtils;
import com.maple.game.osee.controller.gm.base.GmBaseController;
import com.maple.game.osee.dao.data.entity.AgentEntity;
import com.maple.game.osee.dao.data.mapper.AgentMapper;
import com.maple.game.osee.dao.log.entity.AgentCommissionInfoEntity;
import com.maple.game.osee.dao.log.entity.AgentWithdrawLogEntity;
import com.maple.game.osee.dao.log.mapper.AgentCommissionInfoMapper;
import com.maple.game.osee.dao.log.mapper.AgentCommissionMapper;
import com.maple.game.osee.dao.log.mapper.AgentWithdrawLogMapper;
import com.maple.game.osee.entity.gm.CommonResponse;
import com.maple.game.osee.manager.AgentManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
/**
* 渠道商代理控制器
*/
@GmController
public class GmChannelAgentController extends GmBaseController {
@Autowired
private AgentMapper agentMapper;
@Autowired
private AgentManager agentManager;
@Autowired
private AgentCommissionMapper agentCommissionMapper;
@Autowired
private AgentCommissionInfoMapper agentCommissionInfoMapper;
@Autowired
private AgentWithdrawLogMapper agentWithdrawLogMapper;
/**
* 初始分成比例关键字
*/
private static final String INIT_RATE = "Ttmy:Agent:FirstRate";
/**
* 提现申请周期
*/
private static final String FLUSH_TIME = "Ttmy:Agent:FlushTime";
/**
* 获取初始分成比例
*/
private static double getInitRate() {
String rateStr = RedisHelper.get(INIT_RATE);
return StringUtils.isEmpty(rateStr) ? 0.01 : Double.parseDouble(rateStr);
}
/**
* 设置初始分成比例
*/
private static void setInitRate(Double initRate) {
RedisHelper.set(INIT_RATE, initRate.toString());
}
/**
* 获取提现周期
*/
public static int getFlushTime() {
String rateStr = RedisHelper.get(FLUSH_TIME);
return StringUtils.isEmpty(rateStr) ? 7 : Integer.parseInt(rateStr);
}
/**
* 设置提现周期
*/
public static void setFlushTime(Integer flushTime) {
RedisHelper.set(FLUSH_TIME, flushTime.toString());
}
/**
* 渠道列表
*/
@GmHandler(key = "/ttmy/channel/list")
public void doChannelAgentList(Map params, CommonResponse response) throws Exception {
List
评论列表(0条)