当前位置:网站首页>@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);
边栏推荐
- Night God simulator +fiddler packet capture test app
- 链游系统开发(Unity3D链游开发详情)丨链游开发成熟技术源码
- Memory mapping of QT
- 微信核酸检测预约小程序系统毕业设计毕设(1)开发概要
- Please, stop painting star! This has nothing to do with patriotism!
- iptable端口重定向 MASQUERADE[通俗易懂]
- win10 卸载cuda
- 怎么用ps提取图片颜色分析色彩搭配
- Nvidia 显卡 Failed to initialize NVML Driver/library version mismatch 错误解决方案
- Qt官方示例:Qt Quick Controls - Gallery
猜你喜欢

Web版3D可视化工具,程序员应该知道的97件事,AI前沿论文 | 资讯日报 #2022.07.01

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"

300+ documents! This article explains the latest progress of multimodal learning based on transformer

Leetcode 面试题 16.17. 连续数列

【西北工业大学】考研初试复试资料分享

Chrome 正式支持 MathML,默认在 Chromium Dev 105 中启用

Detailed explanation of map set

微信小程序视频分享平台系统毕业设计毕设(3)后台功能

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

UE4 draw a circle with spline
随机推荐
300+篇文献!一文详解基于Transformer的多模态学习最新进展
服务器php环境搭建教程,PHP服务端环境搭建图文详解
UE4 用spline畫正圓
Wechat nucleic acid detection appointment applet system graduation design completion (4) opening report
How can you omit a large number of switch statements
微信小程序视频分享平台系统毕业设计毕设(8)毕业设计论文模板
MySQL about only_ full_ group_ By limit
Aptos tutorial - participate in the official incentive testing network (ait2 incentive testing network)
Qt官方示例:Qt Quick Controls - Gallery
Esp32-c3 introductory tutorial question ⑪ - ESP tls: create_ ssl_ handle failed, tls_ io_ instance->options. trusted_ certs null
Wechat applet video sharing platform system graduation design completion (5) assignment
【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介
深度神经网络总结
Unity学习shader笔记[八十一]简单的颜色调整后处理(亮度,饱和度,对比度)
元宇宙链游系统开发(逻辑开发)丨链游系统开发(详细分析)
NM01-独立于总线协议的NM模块功能概述与API定义
阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
Qt官方示例:Qt Quick Controls - Gallery
Chrome officially supports MathML, which is enabled in chromium dev 105 by default
C语言中函数参数传递的三种方式