|
@@ -2,8 +2,15 @@ package com.miaxis.h5.controller.coach;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Arrays;
|
|
|
+
|
|
|
+import com.miaxis.coach.dto.CoachAuditDTO;
|
|
|
+import com.miaxis.common.constant.Constants;
|
|
|
+import com.miaxis.common.core.domain.entity.UserInfo;
|
|
|
+import com.miaxis.common.utils.SecurityUtils;
|
|
|
+import com.sun.org.apache.bcel.internal.classfile.Constant;
|
|
|
import io.swagger.annotations.*;
|
|
|
import com.miaxis.common.core.domain.Response;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -30,40 +37,40 @@ import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
* @date 2022-05-10
|
|
|
*/
|
|
|
@RestController
|
|
|
-@RequestMapping("/coach/info")
|
|
|
+@RequestMapping(Constants.COACH_PREFIX+"/coach/info")
|
|
|
@Api(tags={"【H5-教练用户】"})
|
|
|
public class CoachInfoController extends BaseController{
|
|
|
@Autowired
|
|
|
private ICoachInfoService coachInfoService;
|
|
|
|
|
|
- /**
|
|
|
- * 查询教练用户列表
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('coach:info: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<CoachInfo> list(@ModelAttribute CoachInfo coachInfo){
|
|
|
- startPage();
|
|
|
- List<CoachInfo> list = coachInfoService.selectCoachInfoList(coachInfo);
|
|
|
- return toResponsePageInfo(list);
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 查询教练用户列表
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('coach:info: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<CoachInfo> list(@ModelAttribute CoachInfo coachInfo){
|
|
|
+// startPage();
|
|
|
+// List<CoachInfo> list = coachInfoService.selectCoachInfoList(coachInfo);
|
|
|
+// return toResponsePageInfo(list);
|
|
|
+// }
|
|
|
|
|
|
- /**
|
|
|
- * 导出教练用户列表
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('coach:info:export')")
|
|
|
- @Log(title = "教练用户", businessType = BusinessTypeEnum.EXPORT)
|
|
|
- @GetMapping("/export")
|
|
|
- @ApiOperation("导出教练用户列表Excel")
|
|
|
- public Response<String> export(@ModelAttribute CoachInfo coachInfo){
|
|
|
- List<CoachInfo> list = coachInfoService.selectCoachInfoList(coachInfo);
|
|
|
- ExcelUtil<CoachInfo> util = new ExcelUtil<CoachInfo>(CoachInfo.class);
|
|
|
- return util.exportExcel(list, "info");
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 导出教练用户列表
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('coach:info:export')")
|
|
|
+// @Log(title = "教练用户", businessType = BusinessTypeEnum.EXPORT)
|
|
|
+// @GetMapping("/export")
|
|
|
+// @ApiOperation("导出教练用户列表Excel")
|
|
|
+// public Response<String> export(@ModelAttribute CoachInfo coachInfo){
|
|
|
+// List<CoachInfo> list = coachInfoService.selectCoachInfoList(coachInfo);
|
|
|
+// ExcelUtil<CoachInfo> util = new ExcelUtil<CoachInfo>(CoachInfo.class);
|
|
|
+// return util.exportExcel(list, "info");
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 获取教练用户详细信息
|
|
@@ -77,40 +84,42 @@ public class CoachInfoController extends BaseController{
|
|
|
){
|
|
|
return Response.success(coachInfoService.getById(id));
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增教练用户
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('coach:info:add')")
|
|
|
- @Log(title = "教练用户", businessType = BusinessTypeEnum.INSERT)
|
|
|
- @PostMapping
|
|
|
- @ApiOperation("新增教练用户")
|
|
|
- public Response<Integer> add(@RequestBody CoachInfo coachInfo){
|
|
|
- return toResponse(coachInfoService.save(coachInfo) ? 1 : 0);
|
|
|
- }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 新增教练用户
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('coach:info:add')")
|
|
|
+// @Log(title = "教练用户", businessType = BusinessTypeEnum.INSERT)
|
|
|
+// @PostMapping
|
|
|
+// @ApiOperation("新增教练用户")
|
|
|
+// public Response<Integer> add(@RequestBody CoachInfo coachInfo){
|
|
|
+// return toResponse(coachInfoService.save(coachInfo) ? 1 : 0);
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 修改教练用户
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('coach:info:edit')")
|
|
|
+// @PreAuthorize("@ss.hasPermi('coach:info:edit')")
|
|
|
@Log(title = "教练用户", businessType = BusinessTypeEnum.UPDATE)
|
|
|
@PutMapping
|
|
|
@ApiOperation("修改教练用户")
|
|
|
- public Response<Integer> edit(@RequestBody CoachInfo coachInfo){
|
|
|
+ public Response<Integer> edit(@RequestBody CoachAuditDTO coachAuditDTO){
|
|
|
+ CoachInfo coachInfo= SecurityUtils.getLoginUser().getCoach();
|
|
|
+ BeanUtils.copyProperties(coachAuditDTO,coachInfo);
|
|
|
return toResponse(coachInfoService.updateById(coachInfo) ? 1 : 0);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 删除教练用户
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('coach:info:remove')")
|
|
|
- @Log(title = "教练用户", businessType = BusinessTypeEnum.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- @ApiOperation("删除教练用户")
|
|
|
- public Response<Integer> remove(
|
|
|
- @ApiParam(name = "ids", value = "教练用户ids参数", required = true)
|
|
|
- @PathVariable Long[] ids
|
|
|
- ){
|
|
|
- return toResponse(coachInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 删除教练用户
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('coach:info:remove')")
|
|
|
+// @Log(title = "教练用户", businessType = BusinessTypeEnum.DELETE)
|
|
|
+// @DeleteMapping("/{ids}")
|
|
|
+// @ApiOperation("删除教练用户")
|
|
|
+// public Response<Integer> remove(
|
|
|
+// @ApiParam(name = "ids", value = "教练用户ids参数", required = true)
|
|
|
+// @PathVariable Long[] ids
|
|
|
+// ){
|
|
|
+// return toResponse(coachInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+// }
|
|
|
}
|