zouxuan 5 gadi atpakaļ
vecāks
revīzija
534b842342

+ 16 - 16
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/RoleController.java

@@ -6,12 +6,13 @@ import com.ym.mec.auth.service.SysMenuService;
 import com.ym.mec.auth.service.SysRoleMenuService;
 import com.ym.mec.auth.service.SysRoleService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
 import java.util.Date;
-import java.util.HashMap;
 
 @RestController()
 @RequestMapping("role")
@@ -32,14 +33,14 @@ public class RoleController extends BaseController {
     }
 
     @ApiOperation("删除角色")
-    @DeleteMapping("/del/{id}")
+    @PostMapping("/del/{id}")
     public Object delRole(@ApiParam(value = "权限编号", required = true) @PathVariable("id") Integer id) {
         return succeed(sysRoleService.delete(id));
     }
 
     @ApiOperation("修改角色")
-    @PutMapping("/update")
-    public Object updateRole(@RequestBody SysRole sysRole) {
+    @PostMapping("/update")
+    public Object updateRole(SysRole sysRole) {
         SysRole roleByCode = sysRoleService.findRoleByCode(sysRole.getRoleCode());
         if(roleByCode != null && !roleByCode.getId().equals(sysRole.getId())){
             return failed("权限标识已存在");
@@ -51,25 +52,26 @@ public class RoleController extends BaseController {
 
     @ApiOperation("新增角色")
     @PostMapping("/add")
-    public Object addRole(@RequestBody SysRole sysRole) {
+    public Object addRole(SysRole sysRole) {
         SysRole roleByCode = sysRoleService.findRoleByCode(sysRole.getRoleCode());
         if(roleByCode != null){
             return failed("权限标识已存在");
         }
-        Date date = new Date();
-        sysRole.setUpdateTime(date);
-        sysRole.setCreateTime(date);
         sysRoleService.insert(sysRole);
         return succeed();
     }
 
+    @ApiOperation("分页查询角色列表")
+    @GetMapping("/queryPage")
+    public Object queryPage(QueryInfo queryInfo) {
+        return succeed(sysRoleService.queryPage(queryInfo));
+    }
+
     @ApiOperation("角色新增菜单权限(批量)")
     @ApiImplicitParams({ @ApiImplicitParam(name = "roleId", value = "角色编号", required = true, dataType = "Integer"),
             @ApiImplicitParam(name = "menuIds", value = "菜单id,逗号分隔", required = true, dataType = "String") })
     @PostMapping("/addRoleMenu")
-    public Object addRoleMenu(@RequestBody HashMap<String,String> param) {
-        String roleId = param.get("roleId");
-        String menuIds = param.get("menuIds");
+    public Object addRoleMenu(String roleId,String menuIds) {
         if(StringUtils.isEmpty(roleId) || StringUtils.isEmpty(menuIds)){
             return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
         }
@@ -80,10 +82,8 @@ public class RoleController extends BaseController {
     @ApiOperation("角色删除菜单权限(批量)")
     @ApiImplicitParams({ @ApiImplicitParam(name = "roleId", value = "角色编号", required = true, dataType = "Integer"),
             @ApiImplicitParam(name = "menuIds", value = "菜单id,逗号分隔", required = true, dataType = "String") })
-    @DeleteMapping("/delRoleMenu")
-    public Object delRoleMenu(@RequestBody HashMap<String,String> param) {
-        String roleId = param.get("roleId");
-        String menuIds = param.get("menuIds");
+    @PostMapping("/delRoleMenu")
+    public Object delRoleMenu(String roleId,String menuIds) {
         if(StringUtils.isEmpty(roleId) || StringUtils.isEmpty(menuIds)){
             return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
         }
@@ -94,7 +94,7 @@ public class RoleController extends BaseController {
     @ApiOperation("根据角色编号查询拥有的菜单列表")
     @ApiImplicitParams({ @ApiImplicitParam(name = "roleId", value = "角色编号", required = true, dataType = "Integer")})
     @GetMapping("/getMenus")
-    public Object getMenus(@RequestBody Integer roleId) {
+    public Object getMenus(Integer roleId) {
         if(roleId == null){
             return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
         }

+ 3 - 7
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/SmsCodeController.java

@@ -38,7 +38,7 @@ public class SmsCodeController extends BaseController {
     @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String")
     @PostMapping("/sendSms")
     @PreAuthorize("@pcs.hasPermissions('sys_user_manage')")
-    public Object sendLoginVerifyCode(@RequestBody String mobile) {
+    public Object sendLoginVerifyCode(String mobile) {
         smsCodeService.sendValidCode(mobile);
         return succeed();
     }
@@ -47,9 +47,7 @@ public class SmsCodeController extends BaseController {
     @ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "code", value = "短信验证码", required = true, dataType = "String") })
     @PostMapping("/verifySmsCode")
-    public Object verifySmsCode(@RequestBody HashMap<String,String> param) {
-        String phone = param.get("phone");
-        String code = param.get("code");
+    public Object verifySmsCode(String phone,String code) {
         if(StringUtils.isEmpty(phone) || StringUtils.isEmpty(code)){
             return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
         }
@@ -63,9 +61,7 @@ public class SmsCodeController extends BaseController {
     @ApiOperation("校验登录图形验证码")
     @ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "code", value = "验证码", required = true, dataType = "String") })
-    public Object verifyImageCode(@RequestBody HashMap<String,String> param){
-        String phone = param.get("phone");
-        String code = param.get("code");
+    public Object verifyImageCode(String phone,String code){
         if(StringUtils.isEmpty(phone) || StringUtils.isEmpty(code)){
             return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
         }

+ 10 - 21
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java

@@ -45,7 +45,7 @@ public class UserController extends BaseController {
 			@ApiImplicitParam(name = "createStartDate", value = "开始注册时间", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "createEndDate", value = "结束注册时间", required = true, dataType = "String") })
 	@GetMapping("/queryPage")
-	public Object queryPage(@RequestBody SysUserQueryInfo queryInfo) {
+	public Object queryPage(SysUserQueryInfo queryInfo) {
 		return succeed(sysUserService.queryPage(queryInfo));
 	}
 
@@ -66,7 +66,7 @@ public class UserController extends BaseController {
 
 	@ApiOperation(value = "新增用户")
 	@PostMapping("/add")
-	public Object add(@RequestBody SysUser sysUser) {
+	public Object add(SysUser sysUser) {
 //		sysUser.setPassword(new BCryptPasswordEncoder().encode(sysUser.getPassword()));
 		sysUserService.insert(sysUser);
 		return succeed();
@@ -77,10 +77,7 @@ public class UserController extends BaseController {
 	@ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "authCode", value = "验证码", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "password", value = "密码", required = true, dataType = "String") })
-	public Object setPassword(@RequestBody HashMap<String,String> param) {
-		String mobile = param.get("mobile");
-		String authCode = param.get("authCode");
-		String password = param.get("password");
+	public Object setPassword(String mobile,String authCode,String password) {
 		if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(authCode) || StringUtils.isEmpty(password)){
 			return failed();
 		}
@@ -103,11 +100,7 @@ public class UserController extends BaseController {
 			@ApiImplicitParam(name = "authCode", value = "验证码", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "newPassword", value = "新密码", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "password", value = "旧密码", required = true, dataType = "String") })
-	public Object updatePassword(@RequestBody HashMap<String,String> param) {
-		String mobile = param.get("mobile");
-		String authCode = param.get("authCode");
-		String password = param.get("password");
-		String newPassword = param.get("newPassword");
+	public Object updatePassword(String mobile,String authCode,String password,String newPassword) {
 		if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(authCode) || StringUtils.isEmpty(password) || StringUtils.isEmpty(newPassword)){
 			return failed("参数校验异常");
 		}
@@ -139,7 +132,7 @@ public class UserController extends BaseController {
 	}*/
 
 	@ApiOperation(value = "修改用户")
-	@PutMapping("/update")
+	@PostMapping("/update")
 	public Object update(SysUser sysUser) {
 		AuthUser user = SecurityUtils.getUser();
 		if(user != null){
@@ -166,10 +159,8 @@ public class UserController extends BaseController {
 	@ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer"),
 			@ApiImplicitParam(name = "roleIds", value = "角色id,逗号分隔", required = true, dataType = "String") })
 	@PostMapping("/addRole")
-	public Object getRole(@RequestBody HashMap<String,String> param) {
-		String userId = param.get("userId");
-		String roleIds = param.get("roleIds");
-		if(StringUtils.isEmpty(param.get("userId")) || StringUtils.isEmpty(param.get("roleIds"))){
+	public Object getRole(String userId,String roleIds) {
+		if(StringUtils.isEmpty(userId) || StringUtils.isEmpty(roleIds)){
 			return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
 		}
 		sysUserRoleService.batchInsert(Integer.parseInt(userId),roleIds);
@@ -179,11 +170,9 @@ public class UserController extends BaseController {
 	@ApiOperation(value = "用户角色删除")
 	@ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer"),
 			@ApiImplicitParam(name = "roleIds", value = "角色id,逗号分隔", required = true, dataType = "String") })
-	@DeleteMapping("/delRole")
-	public Object delRole(@RequestBody HashMap<String,String> param) {
-		String userId = param.get("userId");
-		String roleIds = param.get("roleIds");
-		if(StringUtils.isEmpty(param.get("userId")) || StringUtils.isEmpty(param.get("roleIds"))){
+	@PostMapping("/delRole")
+	public Object delRole(String userId,String roleIds) {
+		if(StringUtils.isEmpty(userId) || StringUtils.isEmpty(roleIds)){
 			return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
 		}
 		sysUserRoleService.batchDel(Integer.parseInt(userId),roleIds);

+ 3 - 6
mec-web/src/main/java/com/ym/mec/web/controller/system/HotWordLabelManageController.java

@@ -7,10 +7,7 @@ import io.swagger.annotations.ApiParam;
 import java.util.Date;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.page.QueryInfo;
@@ -21,7 +18,7 @@ import com.ym.mec.web.service.HotWordsLabelService;
  * @Author Joburgess
  * @Date 2019/9/21
  */
-@Api("热词标签管理")
+@Api(tags = "热词标签管理")
 @RequestMapping("hotWordLabelManage")
 @RestController
 public class HotWordLabelManageController extends BaseController {
@@ -55,7 +52,7 @@ public class HotWordLabelManageController extends BaseController {
 
 
     @ApiOperation("分页查询热词列表")
-    @PostMapping("/queryPage")
+    @GetMapping("/queryPage")
     public Object queryPage(QueryInfo queryInfo){
         return succeed(hotWordsLabelService.queryPage(queryInfo));
     }

+ 8 - 12
mec-web/src/main/java/com/ym/mec/web/controller/system/StudentManageController.java

@@ -5,7 +5,6 @@ import com.ym.mec.web.dal.page.StudentManageAttendanceQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageCourseQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageQueryInfo;
 import com.ym.mec.web.service.StudentManageService;
-import com.ym.mec.web.service.SysUserCashAccountService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -16,7 +15,7 @@ import org.springframework.web.bind.annotation.*;
  * @Author Joburgess
  * @Date 2019/9/19
  */
-@Api("学生管理")
+@Api(tags = "学生管理")
 @RequestMapping("studentManage")
 @RestController
 public class StudentManageController extends BaseController {
@@ -24,12 +23,9 @@ public class StudentManageController extends BaseController {
     @Autowired
     private StudentManageService studentManageService;
 
-    @Autowired
-    private SysUserCashAccountService sysUserCashAccountService;
-
     @ApiOperation(value = "获取学生列表")
     @GetMapping("/queryStudentList")
-    public Object queryStudentList(@RequestBody StudentManageQueryInfo queryInfo){
+    public Object queryStudentList(StudentManageQueryInfo queryInfo){
         return succeed(studentManageService.findStudentsByOrganId(queryInfo));
     }
 
@@ -46,25 +42,25 @@ public class StudentManageController extends BaseController {
     }
 
     @ApiOperation(value = "根据乐团获取排课列表")
-    @PostMapping("/findStudentCourses")
-    public Object findStudentCourses(@RequestBody StudentManageCourseQueryInfo queryInfo){
+    @GetMapping("/findStudentCourses")
+    public Object findStudentCourses(StudentManageCourseQueryInfo queryInfo){
         return succeed(studentManageService.findStudentCourseList(queryInfo));
     }
 
     @ApiOperation(value = "获取学生签到列表")
-    @PostMapping("/findStudentAttendances")
-    public Object findStudentAttendances(@RequestBody StudentManageAttendanceQueryInfo queryInfo){
+    @GetMapping("/findStudentAttendances")
+    public Object findStudentAttendances(StudentManageAttendanceQueryInfo queryInfo){
         return succeed(studentManageService.findStudentAttendances(queryInfo));
     }
 
     @ApiOperation(value = "获取学生vip课")
-    @PostMapping("/findStudentVipGroups")
+    @GetMapping("/findStudentVipGroups")
     public Object findStudentVipGroups(Long userId){
         return succeed(studentManageService.findStudentVipGroups(userId));
     }
 
     @ApiOperation(value = "获取用户默认账户基本信息")
-    @PostMapping("/getUserCashAccountBaseInfo/{userID}")
+    @GetMapping("/getUserCashAccountBaseInfo/{userID}")
     public Object getUserCashAccountBaseInfo(@PathVariable("userID") Long userID){
         return succeed(studentManageService.getStudentAccountBaseInfo(userID));
     }

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/system/VipGroupManageController.java

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
  * @Author Joburgess
  * @Date 2019/9/21
  */
-@Api("vip课")
+@Api(tags = "vip课")
 @RequestMapping("vipGroupManage")
 @RestController
 public class VipGroupManageController extends BaseController {

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/teacher/TeacherVipGroupController.java

@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
  * @Author Joburgess
  * @Date 2019/9/21
  */
-@Api("vip课-教师端")
+@Api(tags = "vip课-教师端")
 @RequestMapping("teacherVipGroup")
 @RestController
 public class TeacherVipGroupController extends BaseController {