首页>代码>基于SpringBoot+Vue的学生选课管理系统代码分享>/student_server/src/main/java/com/auggie/student_server/controller/CourseTeacherController.java
package com.auggie.student_server.controller;

import com.auggie.student_server.entity.Course;
import com.auggie.student_server.entity.CourseTeacher;
import com.auggie.student_server.entity.CourseTeacherInfo;
import com.auggie.student_server.service.CourseTeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @Auther: auggie
 * @Date: 2022/2/10 16:51
 * @Description: CourseTeacherController
 * @Version 1.0.0
 */

@RestController
@CrossOrigin("*")
@RequestMapping("/courseTeacher")
public class CourseTeacherController {
    @Autowired
    private CourseTeacherService courseTeacherService;

    @GetMapping("/insert/{cid}/{tid}/{term}")
    public boolean insert(@PathVariable Integer cid, @PathVariable Integer tid, @PathVariable String term) {
        if (courseTeacherService.findBySearch(cid, tid, term).size() != 0) {
            return false;
        }
        return courseTeacherService.insertCourseTeacher(cid, tid, term);
    }

    @GetMapping("/findMyCourse/{tid}/{term}")
    public List<Course> findMyCourse(@PathVariable Integer tid, @PathVariable String term) {
        System.out.println("查询教师课程:" + tid + " " + term);
        return courseTeacherService.findMyCourse(tid, term);
    }

    @PostMapping("/findCourseTeacherInfo")
    public List<CourseTeacherInfo> findCourseTeacherInfo(@RequestBody Map<String, String> map) {
        return courseTeacherService.findCourseTeacherInfo(map);
    }

    @PostMapping("/deleteById")
    public boolean deleteById(@RequestBody CourseTeacher courseTeacher) {
        return courseTeacherService.deleteById(courseTeacher);
    }
}
最近下载更多
wanglinddad  LV54 3月24日
Demo1111  LV30 3月6日
hyx666110  LV2 3月1日
Boss绝  LV8 2月26日
全栈小陈  LV4 1月21日
zhangjilu  LV18 2023年12月31日
admin_z  LV22 2023年12月27日
xiao小果  LV12 2023年12月13日
lianghui  LV13 2023年11月19日
廖业贵  LV18 2023年11月16日
最近浏览更多
1941549176 4月29日
暂无贡献等级
saaaaaa  LV14 4月16日
ruo12138  LV1 4月11日
1393691335 3月28日
暂无贡献等级
jc121140  LV3 3月25日
xiaozhi丶  LV14 3月24日
wanglinddad  LV54 3月24日
15103432984  LV2 3月17日
sunlzh888888  LV28 3月16日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友