zouxuan 5 سال پیش
والد
کامیت
37da3ce81a

+ 1 - 1
mec-web/pom.xml

@@ -53,7 +53,7 @@
     </dependency>
     <dependency>
       <groupId>com.ym</groupId>
-      <artifactId>mec-common</artifactId>
+      <artifactId>common-core</artifactId>
     </dependency>
   </dependencies>
   <build>

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/App.java → mec-web/src/main/java/com/ym/mec/web/WebApplication.java

@@ -20,8 +20,8 @@ import org.springframework.context.annotation.Configuration;
 @ComponentScan(basePackages="com.ym.mec")
 @Configuration
 @EnableSwagger2Doc
-public class App {
+public class WebApplication {
     public static void main( String[] args ){
-        SpringApplication.run(App.class, args);
+        SpringApplication.run(WebApplication.class, args);
     }
 }

+ 22 - 1
mec-web/src/main/java/com/ym/mec/web/controller/CourseTypeController.java

@@ -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));
+    }
 }

+ 3 - 3
mec-web/src/test/java/com/ym/AppTest.java → mec-web/src/test/java/com/ym/webApplicationTest.java

@@ -7,7 +7,7 @@ import junit.framework.TestSuite;
 /**
  * Unit test for simple App.
  */
-public class AppTest 
+public class webApplicationTest
     extends TestCase
 {
     /**
@@ -15,7 +15,7 @@ public class AppTest
      *
      * @param testName name of the test case
      */
-    public AppTest( String testName )
+    public webApplicationTest(String testName )
     {
         super( testName );
     }
@@ -25,7 +25,7 @@ public class AppTest
      */
     public static Test suite()
     {
-        return new TestSuite( AppTest.class );
+        return new TestSuite( webApplicationTest.class );
     }
 
     /**