|  |  |  | 
|---|
|  |  |  | package com.moral.api.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.moral.api.pojo.dto.group.GroupDTO; | 
|---|
|  |  |  | import com.moral.api.pojo.form.group.AdminGroupUpdateMenuForm; | 
|---|
|  |  |  | import com.moral.api.service.GroupService; | 
|---|
|  |  |  | import com.moral.constant.ResponseCodeEnum; | 
|---|
|  |  |  | import com.moral.constant.ResultMessage; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.CrossOrigin; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @ClassName GroupController | 
|---|
|  |  |  | * @Description TODO | 
|---|
|  |  |  | * @Author 陈凯裕 | 
|---|
|  |  |  | * @Date 2021/5/11 10:16 | 
|---|
|  |  |  | * @Date 2021/5/13 15:29 | 
|---|
|  |  |  | * @Version TODO | 
|---|
|  |  |  | **/ | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | 
|---|
|  |  |  | @RequestMapping("/group") | 
|---|
|  |  |  | public class GroupController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @Description: 给admin角色分配前台菜单 | 
|---|
|  |  |  | * @Param: [] | 
|---|
|  |  |  | * @return: com.moral.constant.ResultMessage | 
|---|
|  |  |  | * @Author: 陈凯裕 | 
|---|
|  |  |  | * @Date: 2021/5/11 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("update") | 
|---|
|  |  |  | public ResultMessage update() { | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | GroupService groupService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("updateAdminGroupMenu") | 
|---|
|  |  |  | public ResultMessage updateMenu(@RequestBody AdminGroupUpdateMenuForm form) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //判断是否缺少参数 | 
|---|
|  |  |  | if (!form.valid()) | 
|---|
|  |  |  | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), | 
|---|
|  |  |  | ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //处理分配业务 | 
|---|
|  |  |  | GroupDTO dto = groupService.updateAdminGroupMenu(form); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return new ResultMessage(dto.getCode(), dto.getMsg(), null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|