parent
e691bb63ba
commit
07639b6008
9 changed files with 122 additions and 1 deletions
@ -0,0 +1,7 @@ |
||||
package com.msdw.tms.api; |
||||
|
||||
import io.swagger.annotations.Api; |
||||
|
||||
@Api(value = "学生管理", tags = "学生管理") |
||||
public interface StudentControllerApi { |
||||
} |
@ -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(); |
||||
} |
||||
} |
@ -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<StudentEntity> { |
||||
} |
@ -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; |
||||
} |
@ -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; |
||||
} |
@ -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<StudentEntity>{ |
||||
|
||||
} |
@ -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<StudentDao,StudentEntity> implements StudentService { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.msdw.tms.dao.StudentDao"> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue