|
@@ -0,0 +1,109 @@
|
|
|
+package com.miaxis.app.controller.coach;
|
|
|
+
|
|
|
+import com.miaxis.coach.domain.CoachManySchool;
|
|
|
+import com.miaxis.coach.service.ICoachManySchoolService;
|
|
|
+import com.miaxis.common.annotation.Log;
|
|
|
+import com.miaxis.common.core.controller.BaseController;
|
|
|
+import com.miaxis.common.core.domain.Response;
|
|
|
+import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
+import com.miaxis.common.enums.BusinessTypeEnum;
|
|
|
+import com.miaxis.common.utils.poi.ExcelUtil;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 【教练员驾校关系】Controller
|
|
|
+ *
|
|
|
+ * @author zhangbin
|
|
|
+ * @date 2023-07-25
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/coach/info")
|
|
|
+@Api(tags={"【小程序-教练员驾校关系】"})
|
|
|
+public class CoachManySchoolController extends BaseController{
|
|
|
+ @Autowired
|
|
|
+ private ICoachManySchoolService coachManySchoolService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询教练员驾校关系列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('coach:coach:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperation("查询教练员驾校关系列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
|
|
|
+ @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
|
|
|
+ })
|
|
|
+ public ResponsePageInfo<CoachManySchool> list(@ModelAttribute CoachManySchool coachManySchool){
|
|
|
+ startPage();
|
|
|
+ List<CoachManySchool> list = coachManySchoolService.selectCoachManySchoolList(coachManySchool);
|
|
|
+ return toResponsePageInfo(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出教练员驾校关系列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('coach:coach:export')")
|
|
|
+ @Log(title = "教练员驾校关系", businessType = BusinessTypeEnum.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ @ApiOperation("导出教练员驾校关系列表Excel")
|
|
|
+ public Response<String> export(@ModelAttribute CoachManySchool coachManySchool){
|
|
|
+ List<CoachManySchool> list = coachManySchoolService.selectCoachManySchoolList(coachManySchool);
|
|
|
+ ExcelUtil<CoachManySchool> util = new ExcelUtil<CoachManySchool>(CoachManySchool.class);
|
|
|
+ return util.exportExcel(list, "coach");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取教练员驾校关系详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('coach:coach:query')")
|
|
|
+ @GetMapping(value = "/{coachId}")
|
|
|
+ @ApiOperation("获取教练员驾校关系详细信息")
|
|
|
+ public Response<CoachManySchool> getInfo(
|
|
|
+ @ApiParam(name = "coachId", value = "教练员驾校关系参数", required = true)
|
|
|
+ @PathVariable("coachId") Long coachId
|
|
|
+ ){
|
|
|
+ return Response.success(coachManySchoolService.getById(coachId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增教练员驾校关系
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('coach:coach:add')")
|
|
|
+ @Log(title = "教练员驾校关系", businessType = BusinessTypeEnum.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation("新增教练员驾校关系")
|
|
|
+ public Response<Integer> add(@RequestBody CoachManySchool coachManySchool){
|
|
|
+ return toResponse(coachManySchoolService.save(coachManySchool) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改教练员驾校关系
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('coach:coach:edit')")
|
|
|
+ @Log(title = "教练员驾校关系", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation("修改教练员驾校关系")
|
|
|
+ public Response<Integer> edit(@RequestBody CoachManySchool coachManySchool){
|
|
|
+ return toResponse(coachManySchoolService.updateById(coachManySchool) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除教练员驾校关系
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('coach:coach:remove')")
|
|
|
+ @Log(title = "教练员驾校关系", businessType = BusinessTypeEnum.DELETE)
|
|
|
+ @DeleteMapping("/{coachIds}")
|
|
|
+ @ApiOperation("删除教练员驾校关系")
|
|
|
+ public Response<Integer> remove(
|
|
|
+ @ApiParam(name = "coachIds", value = "教练员驾校关系ids参数", required = true)
|
|
|
+ @PathVariable Long[] coachIds
|
|
|
+ ){
|
|
|
+ return toResponse(coachManySchoolService.removeByIds(Arrays.asList(coachIds)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|