fix: 添加业务接口并实现

This commit is contained in:
2025-08-08 09:24:24 +08:00
parent 325875b7c5
commit 4a77a59c9b
7 changed files with 59 additions and 9 deletions

View File

@@ -115,7 +115,7 @@ security:
# 多租户配置
tenant:
# 是否开启
enable: true
enable: false
# 排除表
excludes:
- sys_menu

View File

@@ -3,7 +3,8 @@ package org.dromara.controller;
import jakarta.annotation.Resource;
import org.dromara.common.Result;
import org.dromara.domain.Cls;
import org.dromara.service.ClsService;
import org.dromara.service.IClsService;
import org.dromara.service.impl.ClsService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -13,7 +14,7 @@ import java.util.List;
@RequestMapping("/cls")
public class ClsController {
@Resource
private ClsService clsService;
private IClsService clsService;
/**
* 新增数据

View File

@@ -3,7 +3,8 @@ package org.dromara.controller;
import jakarta.annotation.Resource;
import org.dromara.common.Result;
import org.dromara.domain.Student;
import org.dromara.service.StudentService;
import org.dromara.service.IStudentService;
import org.dromara.service.impl.StudentService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -13,7 +14,7 @@ import java.util.List;
@RequestMapping("/student")
public class StudentController {
@Resource
private StudentService studentService;
private IStudentService studentService;
/**
* 新增数据

View File

@@ -0,0 +1,23 @@
package org.dromara.service;
import org.dromara.domain.Cls;
import java.util.List;
/**
* 班级业务接口
*
* @author SkySource
* @Date: 2025/8/8 9:18
*/
public interface IClsService {
void add(Cls cls);
void update(Cls cls);
void deleteById(Integer id);
List<Cls> selectAll(Cls cls);
Cls selectById( Integer id);
}

View File

@@ -0,0 +1,23 @@
package org.dromara.service;
import org.dromara.domain.Student;
import java.util.List;
/**
* 学生Service接口
*
* @author SkySource
* @Date: 2025/8/8 9:21
*/
public interface IStudentService {
void add(Student student);
void update(Student student);
void deleteById(Integer id);
List<Student> selectAll(Student student);
Student selectById( Integer id);
}

View File

@@ -1,15 +1,16 @@
package org.dromara.service;
package org.dromara.service.impl;
import jakarta.annotation.Resource;
import org.dromara.domain.Cls;
import org.dromara.mapper.ClsMapper;
import org.dromara.service.IClsService;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ClsService {
public class ClsService implements IClsService {
@Resource
private ClsMapper clsMapper;

View File

@@ -1,14 +1,15 @@
package org.dromara.service;
package org.dromara.service.impl;
import jakarta.annotation.Resource;
import org.dromara.domain.Student;
import org.dromara.mapper.StudentMapper;
import org.dromara.service.IStudentService;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class StudentService {
public class StudentService implements IStudentService {
@Resource
private StudentMapper studentMapper;