Search in sources :

Example 26 with Result

use of com.alibaba.csp.sentinel.dashboard.domain.Result in project RuoYi-Cloud-Plus by JavaLionLi.

the class DefaultAuthorizationInterceptor method responseNoPrivilegeMsg.

private void responseNoPrivilegeMsg(HttpServletResponse response, String message) throws IOException {
    Result result = Result.ofFail(-1, message);
    response.addHeader("Content-Type", "application/json;charset=UTF-8");
    response.getOutputStream().write(JSON.toJSONBytes(result));
}
Also used : Result(com.alibaba.csp.sentinel.dashboard.domain.Result)

Aggregations

Result (com.alibaba.csp.sentinel.dashboard.domain.Result)26 Test (org.junit.Test)16 WebMvcTest (org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)16 MvcResult (org.springframework.test.web.servlet.MvcResult)16 MockHttpServletRequestBuilder (org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder)16 ApiDefinitionEntity (com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.ApiDefinitionEntity)13 ApiPredicateItemEntity (com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.ApiPredicateItemEntity)13 ApiPredicateItemVo (com.alibaba.csp.sentinel.dashboard.domain.vo.gateway.api.ApiPredicateItemVo)9 NoAuthConfigurationTest (com.alibaba.csp.sentinel.dashboard.config.NoAuthConfigurationTest)8 GatewayFlowRuleEntity (com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.GatewayFlowRuleEntity)8 AddApiReqVo (com.alibaba.csp.sentinel.dashboard.domain.vo.gateway.api.AddApiReqVo)7 UpdateApiReqVo (com.alibaba.csp.sentinel.dashboard.domain.vo.gateway.api.UpdateApiReqVo)7 Date (java.util.Date)7 GatewayParamFlowItemEntity (com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.GatewayParamFlowItemEntity)6 SentinelGatewayConstants (com.alibaba.csp.sentinel.adapter.gateway.common.SentinelGatewayConstants)5 AuthAction (com.alibaba.csp.sentinel.dashboard.auth.AuthAction)5 AuthService (com.alibaba.csp.sentinel.dashboard.auth.AuthService)5 SentinelApiClient (com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient)5 MachineInfo (com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo)5 InMemApiDefinitionStore (com.alibaba.csp.sentinel.dashboard.repository.gateway.InMemApiDefinitionStore)5