当前位置:网站首页>@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);
边栏推荐
- Nm01 function overview and API definition of nm module independent of bus protocol
- Typical application of "stack" - expression evaluation (implemented in C language)
- Memory mapping of QT
- Steamos 3.3 beta release, steam deck Chinese keyboard finally came
- MySQL about only_ full_ group_ By limit
- IPtable port redirection masquerade[easy to understand]
- UE4 draw a circle with spline
- 300+ documents! This article explains the latest progress of multimodal learning based on transformer
- Qt官方示例:Qt Quick Controls - Gallery
- Wechat applet video sharing platform system graduation design completion (4) opening report
猜你喜欢

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

Simulateur nightGod + application de test de capture de paquets Fiddler

Détends - toi encore! Ces nouveaux étudiants peuvent s'installer directement à Shanghai

Nm01 function overview and API definition of nm module independent of bus protocol

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

Please, stop painting star! This has nothing to do with patriotism!

Wechat applet video sharing platform system graduation design completion (6) opening defense ppt

Leetcode interview question 16.17 Continuous sequence

QT official example: QT quick controls - Gallery

Wechat applet video sharing platform system graduation design completion (8) graduation design thesis template
随机推荐
Aptos tutorial - participate in the official incentive testing network (ait2 incentive testing network)
Interview, about thread pool
Leetcode 面试题 16.11. 跳水板
NM01-独立于总线协议的NM模块功能概述与API定义
Wechat applet video sharing platform system graduation design completion (4) opening report
QQmlApplicationEngine
Eliminate the yellow alarm light on IBM p750 small computer [easy to understand]
一款简约PHP个人发卡程序V4.0版本
Redis(6)----对象与数据结构
呆错图床系统源码图片CDN加速与破J防盗链功能
Leetcode 面试题 17.01. 不用加号的加法
Leetcode(154)——寻找旋转排序数组中的最小值 II
Leetcode interview question 17.01 Addition without plus sign
Use dosbox to run the assembly super detailed step "suggestions collection"
iframe嵌套详解
Wechat nucleic acid detection appointment applet system graduation design (2) applet function
Leetcode interview question 17.04 Vanishing numbers
Summary of fun free GM games
Chrome 正式支持 MathML,默认在 Chromium Dev 105 中启用
Wechat nucleic acid detection appointment applet system graduation design completion (1) development outline