|
@@ -1,13 +1,13 @@
|
|
|
package com.yonge.cooleshow.admin.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.Student;
|
|
|
-import com.yonge.cooleshow.biz.dal.entity.Teacher;
|
|
|
import com.yonge.cooleshow.biz.dal.service.StudentService;
|
|
|
import com.yonge.cooleshow.biz.dal.support.Condition;
|
|
|
import com.yonge.cooleshow.biz.dal.support.Query;
|
|
|
-import com.yonge.cooleshow.biz.dal.vo.TeacherHomeVo;
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.StudentVo;
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
|
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
import com.yonge.cooleshow.common.page.PageInfo;
|
|
@@ -15,8 +15,8 @@ import com.yonge.toolset.utils.string.StringUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
+import org.apache.commons.beanutils.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
@@ -26,78 +26,26 @@ import java.util.List;
|
|
|
@RequestMapping("/Student")
|
|
|
@Api(value = "学生表", tags = "学生表")
|
|
|
public class StudentController extends BaseController {
|
|
|
-
|
|
|
@Autowired
|
|
|
private StudentService studentService;
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 查询单条
|
|
|
*/
|
|
|
- @GetMapping("/detail")
|
|
|
+ @GetMapping("/detail/")
|
|
|
@ApiOperation(value = "详情", notes = "传入student")
|
|
|
- public HttpResponseResult<Student> detail(Student student) {
|
|
|
- Student detail = studentService.getOne(Condition.getQueryWrapper(student));
|
|
|
+ public HttpResponseResult<StudentVo> detail(Student student) throws Exception{
|
|
|
+ StudentVo detail = studentService.detail(student.getUserId());
|
|
|
return succeed(detail);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询集合
|
|
|
- */
|
|
|
- @GetMapping("/list")
|
|
|
- @ApiOperation(value = "查询集合", notes = "传入student")
|
|
|
- public HttpResponseResult<List<Student>> list(Student student) {
|
|
|
- List<Student> list = studentService.list();
|
|
|
- return succeed(list);
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 查询分页
|
|
|
*/
|
|
|
@GetMapping("/page")
|
|
|
@ApiOperation(value = "查询分页", notes = "传入student")
|
|
|
- public HttpResponseResult<PageInfo<Student>> page(Student student, Query query) {
|
|
|
- IPage<Student> pages = studentService.selectPage(Condition.getPage(query), student);
|
|
|
+ public HttpResponseResult<PageInfo<StudentVo>> page(Student student, Query query) {
|
|
|
+ IPage<StudentVo> pages = studentService.selectPage(Condition.getPage(query), student);
|
|
|
return succeed(Condition.pageInfo(pages));
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增
|
|
|
- */
|
|
|
- @PostMapping("/save")
|
|
|
- @ApiOperation(value = "新增", notes = "传入student")
|
|
|
- public HttpResponseResult save(@Valid @RequestBody Student student) {
|
|
|
- return status(studentService.save(student));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 修改
|
|
|
- */
|
|
|
- @PostMapping("/update")
|
|
|
- @ApiOperation(value = "修改", notes = "传入student")
|
|
|
- public HttpResponseResult update(@Valid @RequestBody Student student) {
|
|
|
- return status(studentService.updateById(student));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增或修改
|
|
|
- */
|
|
|
- @PostMapping("/submit")
|
|
|
- @ApiOperation(value = "新增或修改", notes = "传入student")
|
|
|
- public HttpResponseResult submit(@RequestBody Student student) {
|
|
|
- return status(studentService.saveOrUpdate(student));
|
|
|
- }
|
|
|
|
|
|
- /**
|
|
|
- * 删除
|
|
|
- */
|
|
|
- @PostMapping("/remove")
|
|
|
- @ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
|
- public HttpResponseResult remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
- if (StringUtil.isEmpty(ids)) {
|
|
|
- return failed("参数不能为空");
|
|
|
- }
|
|
|
- return status(studentService.removeByIds(StringUtil.toLongList(ids)));
|
|
|
- }
|
|
|
}
|