@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils ;
import org.springframework.web.bind.annotation.* ;
import java.util.List ;
@RestController
@RequestMapping ( "tms/classTech" )
public class ClassTeachingController implements ClassTeachingApi {
@ -17,7 +19,7 @@ public class ClassTeachingController implements ClassTeachingApi {
@Autowired
private ClassTeachingService classTeachingService ;
/ * *
/ * *
* 用户端查看班级实验列表
* @param page
* @param size
@ -28,29 +30,36 @@ public class ClassTeachingController implements ClassTeachingApi {
* @param condition
* @return
* /
@GetMapping ( "user/Record" )
public R queryTestRecord ( @RequestParam Integer page , @RequestParam Integer size , @RequestParam Integer month , @RequestParam String startTime , @RequestParam String endTime ,
@RequestParam String condition , @RequestParam Integer status ) {
@Override
@GetMapping ( "userRecord" )
public R queryTestRecord ( @RequestParam Integer page , @RequestParam Integer size , Integer month , @RequestParam String startTime , @RequestParam String endTime ,
String condition , @RequestParam Integer status , @RequestParam Integer isCode ) {
ProjectRecordVo recordVo = new ProjectRecordVo ( ) ;
ExperimentalTeachingEntity entity = new ExperimentalTeachingEntity ( ) ;
if ( status ! = 0 ) { //不限定实验状态
recordVo . setStatus ( status ) ;
}
if ( isCode = = 0 ) {
if ( status ! = 0 ) { //不限定实验状态
recordVo . setStatus ( status ) ;
}
if ( ! StringUtils . isEmpty ( condition ) ) {
recordVo . setCondition ( condition ) ;
}
if ( ! StringUtils . isEmpty ( month ) ) {
recordVo . setMonth ( month ) ;
} else {
recordVo . setMonth ( 0 ) ;
if ( ! StringUtils . isEmpty ( startTime ) ) {
recordVo . setStartTime ( startTime ) ;
} if ( ! StringUtils . isEmpty ( endTime ) ) {
recordVo . setEndTime ( endTime ) ;
recordVo . setEndTime ( endTime ) ;
}
}
recordVo . setIsCode ( isCode ) ;
PageUtils page1 = classTeachingService . queryClassRecord ( page , size , recordVo ) ;
return R . ok ( ) . put ( "page" , page1 ) ;
} else if ( isCode = = 1 ) {
return R . error ( "无需邀请码" ) ;
}
return R . error ( "错误操作,isCode 不能为空" ) ;
}
/ * *
@ -60,7 +69,13 @@ public class ClassTeachingController implements ClassTeachingApi {
* /
@Override
@PostMapping ( "/joinPractice" )
public R joinPractice ( @RequestBody Integer invitationCode , Integer isCode , Integer projectId ) {
public R joinPractice ( @RequestBody ExperimentalTeachingEntity entity1 ) {
//获取参数
Integer isCode = entity1 . getIsCode ( ) ;
Integer projectId = entity1 . getProjectId ( ) ;
Integer invitationCode = entity1 . getInvitationCode ( ) ;
//用于接受参数
ExperimentalTeachingEntity entity = new ExperimentalTeachingEntity ( ) ;
if ( isCode = = 0 ) {
if ( invitationCode ! = null ) {
@ -79,4 +94,11 @@ public class ClassTeachingController implements ClassTeachingApi {
return R . error ( "输入有误,无需邀请码" ) ;
}
}
//查看成绩
@Override
@GetMapping ( "/queryAchievement" )
public R queryAchievement ( ) {
return R . ok ( ) ;
}
}