課程
/后端開發
/Java
/Spring Boot 2.0深度實踐-初遇Spring Boot
這個控制臺打印的
這是
RouterFunctionConfiguration?的代碼
這是postman中的問題
不知道哪里有問題,請大佬指點
2018-10-29
源自:Spring Boot 2.0深度實踐-初遇Spring Boot 2-4
正在回答
package?com.imooc.Second.repository; import?com.imooc.Second.domain.User; import?org.springframework.stereotype.Repository; import?java.util.Collection; import?java.util.concurrent.ConcurrentHashMap; import?java.util.concurrent.ConcurrentMap; import?java.util.concurrent.atomic.AtomicInteger; /** ?*?{@link?User}?{@link?Repository} ?*/ @Repository public?class?UserRepository?{ ????private?final?ConcurrentMap<Integer,?User>?repository=new?ConcurrentHashMap<>(); ????private?final?static?AtomicInteger?idGenerator=new?AtomicInteger(); ????public?boolean?save(User?user){ ????????//??id?from?1?start ????????Integer?id=idGenerator.incrementAndGet(); ????????user.setId(id); ????????return?repository.put(id,user)==null; ????} ????public?Collection<User>?findAll()?{ ????????return?repository.values(); ????} }
在UserRepository里面,老師忘了寫了
路由上有配@configuration注解?
舉報
Spring Boot 2.x/Web Flux/多模塊化項目實踐
1 回答respository 有問題,不知問題出在哪了。
2 回答external libraries里沒有東西??
1 回答有沒有打不出來ConcurrentHashMap,AtomicInteger的?發現沒有相關類啊
1 回答有2個問題:
1 回答沒有2.0.0M5
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-12-03
在UserRepository里面,老師忘了寫了
2018-11-05
路由上有配@configuration注解?