1、swagger接口文档

beetlsql3-dev
陈沅 1 year ago
parent 9f410f0b3a
commit fccfe3d7e3

@ -49,4 +49,6 @@ public interface CoreUserDao extends BaseMapper<CoreUser> {
Map<String,Object> getAdminByNo(String username);
void updateUserId(Long newId,Long oldId);
List<CoreUser> getCoreUserListAndOldIdIsNull();
}

@ -150,6 +150,11 @@ public class CoreUserService extends CoreBaseService<CoreUser> {
return coreUserDao.template(coreUser);
}
public List<CoreUser> getCoreUserListAndOldIdIsNull(){
return coreUserDao.getCoreUserListAndOldIdIsNull();
}
/**
*
* @return

@ -95,3 +95,7 @@ select core_user.old_id AS userId,
core_user.NAME AS NAME,
core_role.NAME AS roleName from core_user JOIN core_user_role ON core_user_role.USER_ID = core_user.ID
JOIN core_role ON core_user_role.ROLE_ID = core_role.ID where core_user.CODE = #username#
getCoreUserListAndOldIdIsNull
===
select * from core_user where old_id is null

@ -38,4 +38,6 @@ public interface SchoolClassDao extends BaseMapper<SchoolClass> {
List<Map<String,Object>> getClassListByMajorId(String majorId);
List<Map<String,Object>> getClassesBySchoolId(Long schoolId);
}

@ -121,4 +121,6 @@ public interface StudentDao extends BaseMapper<Student>{
PageQuery<Map<String,Object>> pagedListStudentInfoByClassId(PageQuery query);
List<Student> findAllBySchoolId(Long schoolId);
}

@ -53,4 +53,7 @@ public interface TeacherDao extends BaseMapper<Teacher>{
List<TeacherExtendSchoolInfo> getTeacherExtendSchoolInfoListByUserIds(String userIds);
List<TeacherUserCenterData.TeacherRuleInfo> getTeacherUserInfoRuleInfo(Long userId, Long teacherId);
List<Teacher> findAllTeacherBySchoolId(Long schoolId);
}

@ -10,6 +10,7 @@ import org.beetl.sql.mapper.annotation.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
@ -43,4 +44,7 @@ public interface UniversitiesCollegesDao extends BaseMapper<UniversitiesColleges
* @return
*/
List<String> getAllUniversitiesColleges();
List<Map<String,Object>> findAllUniversitiesColleges();
}

@ -256,6 +256,10 @@ public class SchoolClassService extends CoreBaseService<SchoolClass> {
return schoolClassDao.getClassesByOrgId(orgId);
}
public List<Map<String,Object>> getClassesBySchoolId(Long schoolId){
return schoolClassDao.getClassesBySchoolId(schoolId);
}
public List<Map<String, Object>> getClassListByMajorId(String majorId) {
return schoolClassDao.getClassListByMajorId(majorId);
}

@ -1631,4 +1631,8 @@ public class StudentService extends CoreBaseService<Student> {
pageQuery.setParas(map);
return studentDao.pagedListStudentInfoByClassId(pageQuery);
}
public List<Student> findAllBySchoolId(Long schoolId) {
return studentDao.findAllBySchoolId(schoolId);
}
}

@ -828,4 +828,9 @@ public class TeacherService extends CoreBaseService<Teacher> {
errorRowIndex, 4, StrUtil.format("已存在的教师编号:\"{}\"", duplicateElement));
}
}
public List<Teacher> findAllTeacherBySchoolId(Long schoolId){
return teacherDao.findAllTeacherBySchoolId(schoolId);
}
}

@ -356,4 +356,9 @@ public class UniversitiesCollegesService extends CoreBaseService<UniversitiesCol
public LambdaQuery<UniversitiesColleges> createLambdaQuery() {
return universitiesCollegesDao.createLambdaQuery();
}
public List<Map<String,Object>> findAll(){
return universitiesCollegesDao.findAllUniversitiesColleges();
}
}

@ -51,6 +51,11 @@ public class AccountController {
private SchoolClassService schoolClassService;
@Autowired
private UniversitySystemService universitySystemService;
@Autowired
private UniversitiesCollegesService universitiesCollegesService;
@Autowired
private TeacherService teacherService;
private final static String URL = "jdbc:sqlserver://120.79.161.177:1433;databaseName=Test.Zhiyun_v2.0;trustServerCertificate=true;encrypt=true";
private final static String USER = "sa";
@ -104,9 +109,9 @@ public class AccountController {
return JsonResult.success(userService.getStudentByNo(username));
} else if (roleName.equals("教师")) {
return JsonResult.success(userService.getTeacherByNo(username));
}else if (roleName.equals("超级管理员")) {
} else if (roleName.equals("超级管理员")) {
return JsonResult.success(userService.getAdminByNo(username));
}else{
} else {
return null;
}
}
@ -835,7 +840,9 @@ public class AccountController {
List<CoreUser> coreUsers = userService.getCoreUserList(coreUser);
int i = 0;
for (CoreUser user : coreUsers) {
if(user.getOldId()!=null){continue;}
if (user.getOldId() != null) {
continue;
}
Connection conn = openConn();
PreparedStatement ps = conn.prepareStatement("select * from EduUsers where username = '" + user.getCode() + "' and IsDeleted = 0");
@ -847,8 +854,49 @@ public class AccountController {
}
closeConn(conn);
ps.close();
System.out.println("已完成:"+i++);
System.out.println("已完成:" + i++);
}
return JsonResult.success();
}
@ApiOperation("修改用户表userid")
@PostMapping("updateUserIdAndOldIdIsNull.json")
public JsonResult updateUserIdAndOldIdIsNull() throws SQLException {
CoreUser coreUser = new CoreUser();
List<CoreUser> coreUsers = userService.getCoreUserListAndOldIdIsNull();
int i = 0;
Long j = 50000L;
for (CoreUser user : coreUsers) {
j++;
user.setOldId(j);
userService.updateTemplate(user);
System.out.println("已完成:" + i++);
}
return JsonResult.success();
}
@ApiOperation("根据学校id查询班级数据")
@GetMapping("getClassesBySchoolId.json")
public JsonResult<List<Map<String, Object>>> getClassesBySchoolId(Long schoolId) {
return JsonResult.success(schoolClassService.getClassesBySchoolId(schoolId));
}
@ApiOperation("获取所有学校")
@GetMapping("findAllSchool.json")
public JsonResult<List<Map<String, Object>>> findAllSchool() {
return JsonResult.success(universitiesCollegesService.findAll());
}
@ApiOperation("根据学校id获取学生信息")
@GetMapping("findAllStudentBySchoolId.json")
public JsonResult<List<Student>> findAllStudentBySchoolId(Long schoolId) {
return JsonResult.success(studentService.findAllBySchoolId(schoolId));
}
@ApiOperation("根据学校id获取教师信息")
@GetMapping("findAllTeacherBySchoolId.json")
public JsonResult<List<Teacher>> findAllTeacherBySchoolId(Long schoolId) {
return JsonResult.success(teacherService.findAllTeacherBySchoolId(schoolId));
}
}

@ -193,3 +193,7 @@ school_class.universities_colleges_id = universities_colleges.universities_colle
getClassListByMajorId
===
select class_id as id,class_name as name from school_class where university_system_id = #majorId#
getClassesBySchoolId
===
select class_id as id,class_name as name from school_class where universities_colleges_id = #schoolId#

@ -2210,3 +2210,8 @@ pagedListStudentInfoByClassId
WHERE 1=1 @if(!isEmpty(classIds)){
and find_in_set(student.class_id ,#classIds#)
@}
findAllBySchoolId
===
select * from student join universities_colleges uc on student.org_id = uc.org_id where universities_colleges_id = #schoolId#

@ -559,3 +559,6 @@ getTeacherUserInfoRuleInfo
and t.user_id =#userId#
@}
findAllTeacherBySchoolId
===
select * from teacher where universities_colleges_id =#schoolId#

@ -279,3 +279,7 @@ getAllUniversitiesColleges
universities_colleges t
WHERE 1
AND t.universities_colleges_status = 1
findAllUniversitiesColleges
===
select universities_colleges_id as id,universities_colleges_name as name from universities_colleges
Loading…
Cancel
Save