当前位置:网站首页>@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);
边栏推荐
- How to use PS to extract image color and analyze color matching
- Paddlepaddle 28 build an automatic coder based on convolution
- Unity学习shader笔记[八十一]简单的颜色调整后处理(亮度,饱和度,对比度)
- 微信核酸检测预约小程序系统毕业设计毕设(3)后台功能
- Nm02 nm module call sequence diagram and code interpretation independent of bus protocol
- Wechat applet video sharing platform system graduation design completion (5) assignment
- 夜神模拟器+Fiddler抓包测试App
- Relax again! These fresh students can settle directly in Shanghai
- 微信小程序视频分享平台系统毕业设计毕设(6)开题答辩PPT
- 再放寬!這些應届生,可直接落戶上海
猜你喜欢

UE4 draw a circle with spline

微信小程序视频分享平台系统毕业设计毕设(1)开发概要

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

【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介

再放寬!這些應届生,可直接落戶上海

QT official example: QT quick controls - Gallery

Simulateur nightGod + application de test de capture de paquets Fiddler

exness深度好文:动性系列-黄金流动性实例分析(五)
![Unity学习shader笔记[八十二]增强单通道颜色渲染的黑白处理](/img/db/d745a434e76511742d1264706b5d9a.png)
Unity学习shader笔记[八十二]增强单通道颜色渲染的黑白处理

ESP32-C3入门教程 问题篇⑩——error: implicit declaration of function ‘esp_blufi_close‘;
随机推荐
再放宽!这些应届生,可直接落户上海
Wechat applet video sharing platform system graduation design completion (6) opening defense ppt
iframe嵌套详解
300+ documents! This article explains the latest progress of multimodal learning based on transformer
1.5.1版本官方docker镜像运行容器,能设置使用 mysql 8驱动吗?
2020 Internet industry terminology
Iframe nesting details
Esp32-c3 introductory tutorial question ⑩ - error: implicit declaration of function 'ESP_ blufi_ close‘;
Leetcode(81)——搜索旋转排序数组 II
Wechat applet video sharing platform system graduation design (3) background function
Ue4 dessine un cercle avec une ligne de contour
ESP32-C3入门教程 问题篇⑪——esp-tls: create_ssl_handle failed, tls_io_instance->options.trusted_certs null
Typical application of "stack" - expression evaluation (implemented in C language)
Redis(7)----数据库与过期键
Qt官方示例:Qt Quick Controls - Gallery
什么是云原生?这回终于能搞明白了!
如何设置VSCode删除整行快捷键?
Leetcode interview question 16.15 Abacus wonderful calculation
Ali was wildly asked by the interviewer on three sides. Redis dared not write 'proficient' on his resume anymore
工业软件讲堂-三维CAD设计软件的核心技术解析----讲坛第二次讲座