当前位置:网站首页>@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);
边栏推荐
- 719. 找出第 K 小的数对距离
- Deep neural network Summary
- Web实时通信技术之Websocket
- MySQL 关于 only_full_group_by 限制
- 300+篇文献!一文详解基于Transformer的多模态学习最新进展
- [Yugong series] July 2022 go teaching course 001 introduction to go language premise
- QQmlApplicationEngine
- Installation tutorial and simple call of Matplotlib
- Leetcode interview question 17.01 Addition without plus sign
- 科技公司不同人对Bug的反应 | 每日趣闻
猜你喜欢

Night God simulator +fiddler packet capture test app

Ali was wildly asked by the interviewer on three sides. Redis dared not write 'proficient' on his resume anymore

微信核酸检测预约小程序系统毕业设计毕设(2)小程序功能

Leetcode interview question 17.01 Addition without plus sign

阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了

Leetcode 面试题 17.04. 消失的数字

Wechat applet video sharing platform system graduation design completion (8) graduation design thesis template

Leetcode 面试题 16.11. 跳水板

UE4 用spline畫正圓

Please, stop painting star! This has nothing to do with patriotism!
随机推荐
Détends - toi encore! Ces nouveaux étudiants peuvent s'installer directement à Shanghai
Wechat applet video sharing platform system graduation design completion (8) graduation design thesis template
Server PHP environment building tutorial, PHP server environment building graphic explanation
Leetcode 面试题 17.01. 不用加号的加法
NM02-独立于总线协议的NM模块调用序列图及代码解释
iframe嵌套详解
NVIDIA graphics card failed to initialize nvml driver/library version mismatch error solution
Pit encountered during installation of laravel frame
阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
Ue4 dessine un cercle avec une ligne de contour
夜神模擬器+Fiddler抓包測試App
paddlepaddle 28 搭建基于卷积的自动编码机
QQmlApplicationEngine
【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介
@Component 拿不到dao层
Wechat applet video sharing platform system graduation design (3) background function
Simulateur nightGod + application de test de capture de paquets Fiddler
Wechat nucleic acid detection appointment applet system graduation design completion (1) development outline
Deep neural network Summary
Summary of fun free GM games