2024-07-08
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
Because if you want to operate the database when reading data, you must use the constructor to pass dao or service. Because this is not managed by spring and cannot be automatically injected, you need to pass service or dao in the parameters.
@Autowired
IEduSubjectService subjectService;
添加课程分类的方法 (文件本身不用保存到服务器,只是要将文件中的内容解析出来保存到数据库)
@RequestMapping("/addSubject")
public R addSubject(@RequestPart MultipartFile file) {
subjectService.saveSubject(file,subjectService);
return R.ok();
}
public interface IEduSubjectService extends IService