当前位置:网站首页>@Component cannot get Dao layer
@Component cannot get Dao layer
2022-07-02 18:40:00 【Woo, Allen】
@Slf4j
@ServerEndpoint("/webSocket/addOrder/{userId}")
@Component
public class AddOrderSocket {
@Resource
ScreenshotLogRepository screenshotLogRepository;
Can't get dao layer
Take it like this
package com.gm.wj.service;
import com.gm.wj.entity.ScreenshotLog;
import com.gm.wj.repository.ScreenshotLogRepository;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
@Component
public class WebSocketDbService {
// public static MqttEquipRedService mqttRideService;
public static WebSocketDbService webSocketDbService;
@Resource
public ScreenshotLogRepository screenshotLogRepository;
@PostConstruct
public void init() {
webSocketDbService = this;
}
}
ScreenshotLogRepository screenshotLogRepository=
WebSocketDbService.webSocketDbService.screenshotLogRepository;
log.info("screenshotLogRepository {}",screenshotLogRepository);
if(screenshotLogRepository==null){
log.info("screenshotLogRepository yes null ");
return;
}
log.info("screenshotLog {}",screenshotLog);
screenshotLog.setCreateTime(new Date());
// ScreenshotLog screenshotLog = jsonObject.toJavaObject(ScreenshotLog.class);
ScreenshotLog save = screenshotLogRepository.save(screenshotLog);
log.info("save {}",save);
边栏推荐
- Eliminate the yellow alarm light on IBM p750 small computer [easy to understand]
- 再放寬!這些應届生,可直接落戶上海
- A4988 and 42 stepper motors
- UE4 用spline画正圆
- What is cloud primordial? This time, I can finally understand!
- Use dosbox to run the assembly super detailed step "suggestions collection"
- Nm01 function overview and API definition of nm module independent of bus protocol
- Chrome officially supports MathML, which is enabled in chromium dev 105 by default
- 饭卡 HDU2546
- 【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介
猜你喜欢
300+篇文献!一文详解基于Transformer的多模态学习最新进展
Qt官方示例:Qt Quick Controls - Gallery
Babbitt | metauniverse daily must read: can you buy a virtual anchor for 1000 yuan? Is this the live gospel of small businesses or "cutting leeks"
再放寬!這些應届生,可直接落戶上海
Qt Official examples: Qt Quick Controls - Gallery
微信核酸检测预约小程序系统毕业设计毕设(3)后台功能
Wechat applet video sharing platform system graduation design (3) background function
Qt官方示例:Qt Quick Controls - Gallery
NVIDIA graphics card failed to initialize nvml driver/library version mismatch error solution
阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
随机推荐
Meta universe chain game system development (logic development) - chain game system development (detailed analysis)
微信核酸检测预约小程序系统毕业设计毕设(2)小程序功能
Qt Official examples: Qt Quick Controls - Gallery
RDK simulation experiment
一款简约PHP个人发卡程序V4.0版本
Night God simulator +fiddler packet capture test app
300+篇文献!一文详解基于Transformer的多模态学习最新进展
Wechat nucleic acid detection appointment applet system graduation design completion (1) development outline
719. Find the distance of the number pair with the smallest K
Leetcode interview question 16.11 Diving board
Pit encountered during installation of laravel frame
QQmlApplicationEngine
iptable端口重定向 MASQUERADE[通俗易懂]
Redis(6)----对象与数据结构
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
消除IBM P750小机上的黄色报警灯[通俗易懂]
“栈”的典型应用—表达式求值(C语言实现)
Typical application of "stack" - expression evaluation (implemented in C language)
文字编辑器 希望有错误的句子用红色标红,文字编辑器用了markdown
Use dosbox to run the assembly super detailed step "suggestions collection"