參考主流游戲做一個禮包碼發碼的系統
數據庫定義
返回異常的幾個枚舉狀態
//禮包碼無效
public static final String GIFT_CODE_NOT_VALIDATE = "GIFT_CODE_NOT_VALIDATE";
//禮包碼已使用
public static final String GIFT_CODE_USED = "GIFT_CODE_USED";
//禮包碼使用異常
public static final String GIFT_CODE_REWARD_ERROR = "GIFT_CODE_REWARD_ERROR";
獎勵字段的配置定義
類型-tid-數量
eg. 0-1000-100|0-1002-10|3-3004-1|2-2604-2|1-11001-1
返回結果
- GiftCodeRewardBack(succ:true,
- rewardObj:RewardRespon(
- currencys:[
- CurrencyChanged(type:1000, currVaule:9828570, changedValue:100),
- CurrencyChanged(type:1002, currVaule:350, changedValue:10)
- ],
- items:[
- Item(dbId:1708, tid:3004, type:3, amount:1),
- Item(dbId:1709, tid:2604, type:2, amount:2)
- ],
- equipments:[
- Equipment(dbId:6985, tid:11001, quality:0, lv:1, attribute:{}, affixGroup:[], affixType:[], affix:[], hole:0, holeArray:[], linkArray:[])]),
- rewardStr:0-1000-100|0-1002-10|3-3004-1|2-2604-2|1-11001-1
- )
類型枚舉定義
public static final int Currency =0;
public static final int Equipment =1;
public static final int Material =2;
public static final int Consumable =3;
貨幣tid定義
public static final int SacredCrystal =1000;//鑽石
public static final int Gold =1001;//金幣
public static final int Crystal =1002;//水晶
public static final int BookExp =1003;//靈魂經驗
public static final int ReExp =1004;//潛能經驗
public static final int MagicStone =1005;//魔法石
public static final int InnerFire =1006;//心靈之火
public static final int LuckyCoin =1007;//幸運幣
買一送一 日常掃盲
mysql的常用類型
Date 2020-05-21
Datetime 2020-05-21 15:59:41
遇到了數據庫的時區問題.最終在mybatis的url參數中 &serverTimezone=GMT%2B8