|
@@ -9,6 +9,8 @@ import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
@RequestMapping
|
|
|
@Api(description = "课程类型服务")
|
|
|
@RestController
|
|
@@ -19,7 +21,26 @@ public class CourseTypeController extends BaseController {
|
|
|
|
|
|
@ApiOperation("新增课程类型")
|
|
|
@PutMapping("/add")
|
|
|
- public Object getRole(CourseType courseType) {
|
|
|
+ public Object addCourseType(CourseType courseType) {
|
|
|
return succeed(courseTypeService.insert(courseType));
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation("删除课程类型")
|
|
|
+ @DeleteMapping("/del/{id}")
|
|
|
+ public Object delCourseType(@ApiParam(value = "课程类型编号", required = true) @PathVariable("id") Integer id) {
|
|
|
+ return succeed(courseTypeService.delete(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("修改课程类型")
|
|
|
+ @PutMapping("/update")
|
|
|
+ public Object update(CourseType courseType) {
|
|
|
+ courseType.setUpdateTime(new Date());
|
|
|
+ return succeed(courseTypeService.update(courseType));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("查询课程类型")
|
|
|
+ @PutMapping("/query/{id}")
|
|
|
+ public Object getCourseType(@ApiParam(value = "课程类型编号", required = true) @PathVariable("id") Integer id) {
|
|
|
+ return succeed(courseTypeService.get(id));
|
|
|
+ }
|
|
|
}
|