当前位置:网站首页>@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);
边栏推荐
- 面试,关于线程池的那些事
- 初夏,开源魔改一个带击杀音效的电蚊拍!
- Detailed explanation of cjson usage
- Wechat applet video sharing platform system graduation design (2) applet function
- Wechat nucleic acid detection appointment applet system graduation design completion (1) development outline
- 再放宽!这些应届生,可直接落户上海
- “栈”的典型应用—表达式求值(C语言实现)
- Use dosbox to run the assembly super detailed step "suggestions collection"
- vi/vim 删除:一行, 一个字符, 单词, 每行第一个字符 命令
- C # detect whether the picture is rotated and modified to the true rotation
猜你喜欢

UE4 draw a circle with spline

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

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

揭秘得物客服IM全链路通信过程

Wechat applet video sharing platform system graduation design completion (1) development outline

一款简约PHP个人发卡程序V4.0版本

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

300+篇文献!一文详解基于Transformer的多模态学习最新进展

Esp32-c3 introductory tutorial question ⑩ - error: implicit declaration of function 'ESP_ blufi_ close‘;

再放宽!这些应届生,可直接落户上海
随机推荐
又一所双非改考408,会爆冷么?南昌航空大学软件学院
微信小程序视频分享平台系统毕业设计毕设(8)毕业设计论文模板
Aptos教程-参与官方激励测试网(AIT2 激励测试网)
Leetcode 面试题 17.01. 不用加号的加法
Leetcode interview question 17.01 Addition without plus sign
Web版3D可视化工具,程序员应该知道的97件事,AI前沿论文 | 资讯日报 #2022.07.01
再放寬!這些應届生,可直接落戶上海
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
初夏,开源魔改一个带击杀音效的电蚊拍!
Radian to angle, angle to radian in MATLAB
Leetcode 面试题 16.11. 跳水板
27:第三章:开发通行证服务:10:【注册/登录】接口:注册/登录OK后,把用户会话信息(uid,utoken)保存到redis和cookie中;(一个主要的点:设置cookie)
Win10 uninstall CUDA
Renren potential field method
Aptos tutorial - participate in the official incentive testing network (ait2 incentive testing network)
C# 检测图片是否被旋转并修改到正真的旋转
拿起相机,便是最好的艺术疗愈
链游系统开发(Unity3D链游开发详情)丨链游开发成熟技术源码
Server PHP environment building tutorial, PHP server environment building graphic explanation
MySQL about only_ full_ group_ By limit