refactor(video): 使用@Autowired注解简化依赖注入
- 移除了构造函数注入方式 - 添加了@Autowired注解实现字段注入 - 简化了VModelMapper的依赖管理 - 提高了代码可读性和维护性
This commit is contained in:
@@ -3,6 +3,7 @@ package com.ruoyi.video.service.impl;
|
||||
import com.ruoyi.video.domain.VModel;
|
||||
import com.ruoyi.video.mapper.VModelMapper;
|
||||
import com.ruoyi.video.service.IVModelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -11,11 +12,9 @@ import java.util.Map;
|
||||
@Service
|
||||
public class VModelServiceImpl implements IVModelService {
|
||||
|
||||
private final VModelMapper mapper;
|
||||
@Autowired
|
||||
private VModelMapper mapper;
|
||||
|
||||
public VModelServiceImpl(VModelMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(VModel model) {
|
||||
|
||||
Reference in New Issue
Block a user