|  | @@ -0,0 +1,106 @@
 | 
	
		
			
				|  |  | +package com.ruoyi.web.controller.sim;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import java.util.List;
 | 
	
		
			
				|  |  | +import javax.servlet.http.HttpServletResponse;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | +import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | +import org.springframework.security.access.prepost.PreAuthorize;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.GetMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.PostMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.PutMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.DeleteMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.PathVariable;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RequestBody;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.annotation.Log;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.core.controller.BaseController;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.core.domain.AjaxResult;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.enums.BusinessType;
 | 
	
		
			
				|  |  | +import com.ruoyi.sim.domain.Major;
 | 
	
		
			
				|  |  | +import com.ruoyi.sim.service.IMajorService;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.utils.poi.ExcelUtil;
 | 
	
		
			
				|  |  | +import com.ruoyi.common.core.page.TableDataInfo;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * sim-专业Controller
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * @author tom
 | 
	
		
			
				|  |  | + * @date 2024-12-10
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +@Api("专业管理")
 | 
	
		
			
				|  |  | +@RestController
 | 
	
		
			
				|  |  | +@RequestMapping("/sim/major")
 | 
	
		
			
				|  |  | +public class MajorController extends BaseController {
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private IMajorService majorService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 查询sim-专业列表
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @ApiOperation("查询sim-专业列表")
 | 
	
		
			
				|  |  | +    // @PreAuthorize("@ss.hasPermi('sim:major:list')")
 | 
	
		
			
				|  |  | +    @GetMapping("/list")
 | 
	
		
			
				|  |  | +    public TableDataInfo list(Major major) {
 | 
	
		
			
				|  |  | +        startPage();
 | 
	
		
			
				|  |  | +        List<Major> list = majorService.selectMajorList(major);
 | 
	
		
			
				|  |  | +        return getDataTable(list);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 导出sim-专业列表
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @PreAuthorize("@ss.hasPermi('sim:major:export')")
 | 
	
		
			
				|  |  | +    @Log(title = "sim-专业", businessType = BusinessType.EXPORT)
 | 
	
		
			
				|  |  | +    @PostMapping("/export")
 | 
	
		
			
				|  |  | +    public void export(HttpServletResponse response, Major major) {
 | 
	
		
			
				|  |  | +        List<Major> list = majorService.selectMajorList(major);
 | 
	
		
			
				|  |  | +        ExcelUtil<Major> util = new ExcelUtil<Major>(Major.class);
 | 
	
		
			
				|  |  | +        util.exportExcel(response, list, "sim-专业数据");
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 获取sim-专业详细信息
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @ApiOperation("获取sim-专业详细信息")
 | 
	
		
			
				|  |  | +    // @PreAuthorize("@ss.hasPermi('sim:major:query')")
 | 
	
		
			
				|  |  | +    @GetMapping(value = "/{majorId}")
 | 
	
		
			
				|  |  | +    public AjaxResult getInfo(@PathVariable("majorId") Long majorId) {
 | 
	
		
			
				|  |  | +        return success(majorService.selectMajorByMajorId(majorId));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 新增sim-专业
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @ApiOperation("新增sim-专业")
 | 
	
		
			
				|  |  | +    // @PreAuthorize("@ss.hasPermi('sim:major:add')")
 | 
	
		
			
				|  |  | +    @Log(title = "sim-专业", businessType = BusinessType.INSERT)
 | 
	
		
			
				|  |  | +    @PostMapping
 | 
	
		
			
				|  |  | +    public AjaxResult add(@RequestBody Major major) {
 | 
	
		
			
				|  |  | +        return toAjax(majorService.insertMajor(major));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 修改sim-专业
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @ApiOperation("修改sim-专业")
 | 
	
		
			
				|  |  | +    // @PreAuthorize("@ss.hasPermi('sim:major:edit')")
 | 
	
		
			
				|  |  | +    @Log(title = "sim-专业", businessType = BusinessType.UPDATE)
 | 
	
		
			
				|  |  | +    @PutMapping
 | 
	
		
			
				|  |  | +    public AjaxResult edit(@RequestBody Major major) {
 | 
	
		
			
				|  |  | +        return toAjax(majorService.updateMajor(major));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 删除sim-专业
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @ApiOperation("删除sim-专业")
 | 
	
		
			
				|  |  | +    // @PreAuthorize("@ss.hasPermi('sim:major:remove')")
 | 
	
		
			
				|  |  | +    @Log(title = "sim-专业", businessType = BusinessType.DELETE)
 | 
	
		
			
				|  |  | +    @DeleteMapping("/{majorIds}")
 | 
	
		
			
				|  |  | +    public AjaxResult remove(@PathVariable Long[] majorIds) {
 | 
	
		
			
				|  |  | +        return toAjax(majorService.deleteMajorByMajorIds(majorIds));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +}
 |