diff --git a/src/main/java/com/msdw/tms/api/StudentControllerApi.java b/src/main/java/com/msdw/tms/api/StudentControllerApi.java new file mode 100644 index 0000000..e448eea --- /dev/null +++ b/src/main/java/com/msdw/tms/api/StudentControllerApi.java @@ -0,0 +1,7 @@ +package com.msdw.tms.api; + +import io.swagger.annotations.Api; + +@Api(value = "学生管理", tags = "学生管理") +public interface StudentControllerApi { +} diff --git a/src/main/java/com/msdw/tms/controller/StudentController.java b/src/main/java/com/msdw/tms/controller/StudentController.java new file mode 100644 index 0000000..04405bf --- /dev/null +++ b/src/main/java/com/msdw/tms/controller/StudentController.java @@ -0,0 +1,32 @@ +package com.msdw.tms.controller; + +import com.msdw.tms.api.StudentControllerApi; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.UserInfoEntity; +import com.msdw.tms.entity.vo.StudentVo; +import com.msdw.tms.service.StudentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 学生管理 + */ +@RestController +@RequestMapping("/tms/student") +public class StudentController implements StudentControllerApi{ + + @Autowired + private StudentService studentService; + + @PostMapping("addStudent") + public R addStudent(StudentVo studentVo){ + UserInfoEntity userInfoList = studentVo.getUserInfoList(); + userInfoList.setUniqueIdentificationAccount(String.valueOf(System.currentTimeMillis())); +// studentService.addStudent(studentVo,userInfoList); + return R.ok(); + } +} diff --git a/src/main/java/com/msdw/tms/dao/StudentDao.java b/src/main/java/com/msdw/tms/dao/StudentDao.java new file mode 100644 index 0000000..f3c88e9 --- /dev/null +++ b/src/main/java/com/msdw/tms/dao/StudentDao.java @@ -0,0 +1,9 @@ +package com.msdw.tms.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.msdw.tms.entity.StudentEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface StudentDao extends BaseMapper { +} diff --git a/src/main/java/com/msdw/tms/entity/StudentEntity.java b/src/main/java/com/msdw/tms/entity/StudentEntity.java new file mode 100644 index 0000000..b2a032d --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/StudentEntity.java @@ -0,0 +1,33 @@ +package com.msdw.tms.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@TableName("tms_student") +@Accessors(chain = true) +public class StudentEntity { + + // 学生主键id + @TableId(type = IdType.AUTO) + private Integer studentId; + // 绑定学校Id + private Integer schoolId; + //绑定用户Id + private Integer userId; + //学号 + private String studentIdNumber; + //绑定专业Id + private Integer professionalId; + //绑定年级Id + private Integer gradeId; + //绑定班级Id、 + private Integer classId; + //绑定角色Id + private Integer roleId; + //是否删除(0未删除,1已删除) + private Integer isdel; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/StudentVo.java b/src/main/java/com/msdw/tms/entity/vo/StudentVo.java new file mode 100644 index 0000000..e5a7390 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/StudentVo.java @@ -0,0 +1,15 @@ +package com.msdw.tms.entity.vo; + +import com.msdw.tms.entity.StudentEntity; +import com.msdw.tms.entity.UserInfoEntity; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +@Data +@Accessors(chain = true) +public class StudentVo extends StudentEntity { + + private UserInfoEntity userInfoList; +} diff --git a/src/main/java/com/msdw/tms/service/StudentService.java b/src/main/java/com/msdw/tms/service/StudentService.java new file mode 100644 index 0000000..6b3dab0 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/StudentService.java @@ -0,0 +1,8 @@ +package com.msdw.tms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.msdw.tms.entity.StudentEntity; + +public interface StudentService extends IService{ + +} diff --git a/src/main/java/com/msdw/tms/service/impl/StudentServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/StudentServiceImpl.java new file mode 100644 index 0000000..ebf611f --- /dev/null +++ b/src/main/java/com/msdw/tms/service/impl/StudentServiceImpl.java @@ -0,0 +1,12 @@ +package com.msdw.tms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.msdw.tms.dao.StudentDao; +import com.msdw.tms.entity.StudentEntity; +import com.msdw.tms.service.StudentService; +import org.springframework.stereotype.Service; + +@Service("studentService") +public class StudentServiceImpl extends ServiceImpl implements StudentService { + +} diff --git a/src/main/resources/mapper/tms/ExperimentalStudentDao.xml b/src/main/resources/mapper/tms/ExperimentalStudentDao.xml index 009b806..9ef40ff 100644 --- a/src/main/resources/mapper/tms/ExperimentalStudentDao.xml +++ b/src/main/resources/mapper/tms/ExperimentalStudentDao.xml @@ -7,6 +7,6 @@ - INSERT INTO tms_experimental_student(projectId,userId) VALUES (#{id},#{userId}) + INSERT INTO tms_experimental_student(projectId,userId) VALUES (#{projectId},#{userId}) \ No newline at end of file diff --git a/src/main/resources/mapper/tms/StudentDao.xml b/src/main/resources/mapper/tms/StudentDao.xml new file mode 100644 index 0000000..baa1f80 --- /dev/null +++ b/src/main/resources/mapper/tms/StudentDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file