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