当前位置:网站首页>@Component 拿不到dao层
@Component 拿不到dao层
2022-07-02 17:04:00 【呜呜艾伦】
@Slf4j
@ServerEndpoint("/webSocket/addOrder/{userId}")
@Component
public class AddOrderSocket {
@Resource
ScreenshotLogRepository screenshotLogRepository;
拿不到dao层
这样拿
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 是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);
边栏推荐
- Wechat nucleic acid detection appointment applet system graduation design completion (4) opening report
- Remember to use ternary expressions when switching transformations
- Leetcode 面试题 16.15. 珠玑妙算
- 使用NPOI导出Excel文件
- 初夏,开源魔改一个带击杀音效的电蚊拍!
- 微信核酸检测预约小程序系统毕业设计毕设(3)后台功能
- Night God simulator +fiddler packet capture test app
- 夜神模擬器+Fiddler抓包測試App
- 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"
猜你喜欢

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

1288_ Implementation analysis of vtask resume() interface and interrupt Security version interface in FreeRTOS

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

能解决80%故障的排查思路

科技公司不同人对Bug的反应 | 每日趣闻

Nvidia 显卡 Failed to initialize NVML Driver/library version mismatch 错误解决方案

Pit encountered during installation of laravel frame

夜神模擬器+Fiddler抓包測試App

再放宽!这些应届生,可直接落户上海

微信小程序视频分享平台系统毕业设计毕设(3)后台功能
随机推荐
Nvidia 显卡 Failed to initialize NVML Driver/library version mismatch 错误解决方案
300+篇文献!一文详解基于Transformer的多模态学习最新进展
C # detect whether the picture is rotated and modified to the true rotation
Relax again! These fresh students can settle directly in Shanghai
A4988 and 42 stepper motors
Simulateur nightGod + application de test de capture de paquets Fiddler
如何设置VSCode删除整行快捷键?
Chrome officially supports MathML, which is enabled in chromium dev 105 by default
ESP32-C3入门教程 问题篇⑩——error: implicit declaration of function ‘esp_blufi_close‘;
夜神模擬器+Fiddler抓包測試App
Rte11 interrupt decoupling function
UE4 draw a circle with spline
Leetcode interview question 16.17 Continuous sequence
1.5.1版本官方docker镜像运行容器,能设置使用 mysql 8驱动吗?
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
300+ documents! This article explains the latest progress of multimodal learning based on transformer
Ue4 dessine un cercle avec une ligne de contour
Leetcode 面试题 17.01. 不用加号的加法
巴比特 | 元宇宙每日必读:一千块就能买一个虚拟主播?这是小企业的直播福音还是在“割韭菜”?...
Nm02 nm module call sequence diagram and code interpretation independent of bus protocol