課程
/后端開發
/Java
/Java高并發秒殺API之web層
userPhone不是應該為空嗎?怎么就可以運行了?/
2017-08-08
源自:Java高并發秒殺API之web層 5-4
正在回答
success為false應該是自己給的吧,不是說獲取數據失敗返回false,后面老師不是有改false為true嗎
try {
SeckillExecution execution =seckillService.excuteSeckill(seckillId, phone, md5);
return new SeckillResult<SeckillExecution>(true, execution);
} catch (RepeatKillException e) {
SeckillExecution execution = new SeckillExecution(seckillId, SeckillStateEnum.REPEAT_KILL);
} catch (SeckillCloseException e) {
SeckillExecution execution = new SeckillExecution(seckillId, SeckillStateEnum.END);
} catch (Exception e) {
SeckillExecution execution = new SeckillExecution(seckillId, SeckillStateEnum.INNER_ERROR);
}
舉報
Java實現高并發秒殺API的第三門課,介紹Web層的設計和實現
3 回答@CookieValue cookie為空
2 回答oracle id 類型number 實體 int 為什么為空?
1 回答web為什么是紅色
1 回答為什么庫存是0
1 回答為啥前面的detail一開始檢驗seckillId為空,后面的exposer和execution沒有
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-08-10
success為false應該是自己給的吧,不是說獲取數據失敗返回false,后面老師不是有改false為true嗎
try {
SeckillExecution execution =seckillService.excuteSeckill(seckillId, phone, md5);
return new SeckillResult<SeckillExecution>(true, execution);
} catch (RepeatKillException e) {
SeckillExecution execution = new SeckillExecution(seckillId, SeckillStateEnum.REPEAT_KILL);
return new SeckillResult<SeckillExecution>(true, execution);
} catch (SeckillCloseException e) {
SeckillExecution execution = new SeckillExecution(seckillId, SeckillStateEnum.END);
return new SeckillResult<SeckillExecution>(true, execution);
} catch (Exception e) {
SeckillExecution execution = new SeckillExecution(seckillId, SeckillStateEnum.INNER_ERROR);
return new SeckillResult<SeckillExecution>(true, execution);
}