package com.tuoheng.miniprogram.controller;

import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.miniprogram.entity.query.RoleClientQuery;
import com.tuoheng.miniprogram.service.OpPermissionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ChengWang
 * @Date 2022/12/23
 */
@RestController
@RequestMapping("/permission")
public class PermissionController {

    @Autowired
    private OpPermissionsService permissionsService;

    /**
     * 根据 RoleId 获取用户权限
     *
     * @return
     */
    @GetMapping("/getRolePermission")
    public JsonResult getMenuAndPermissionByRoleId(RoleClientQuery query) {
        return permissionsService.getRolePermissionByRoleId(query);
    }
}
