public async Task AddApiResource()
        {
            string d = "944d6r8wQsImSaty53p12JQ4VdmpMO0r".Sha512();
            IApiResourceService service = Startup.CreateCluster().GrainFactory.GetGrain <IApiResourceService>(0);
            var request = new DTO.ApiResourceAddRequestDto()
            {
                Description = "COTC_API",
                DisplayName = "COTC服务",
                Name        = "COTC_API"
            };
            var secret = new DTO.SecretDto("d7sUJjDOwN5QgqqWIhQoXKMqQR13HKpL", "基金服务-d7sUJjDOwN5QgqqWIhQoXKMqQR13HKpL", Convert.ToDateTime("2030-01-01 12:12:12"));

            request.Secrets.Add(secret);
            var r = await service.AddAsync(request);
        }
        public async Task <ActionResult <JsonResponse <bool> > > Post([FromBody] ApiResource model)
        {
            await _apiService.AddAsync(model);

            return(JsonResponse(true));
        }
Esempio n. 3
0
        public async Task <ActionResult <ApiResourceDTO> > CreateApiResourceAsync([FromBody] ApiResourceDTO dto)
        {
            var result = await apiResourceService.AddAsync(dto);

            return(Ok(result));
        }
Esempio n. 4
0
        public async Task <IActionResult> CreateApiResource([FromBody] ApiResource apiResource)
        {
            var result = await _apiResourceService.AddAsync(apiResource);

            return(result == null || !result.IsSuccessful ? BadRequest() : (IActionResult)Ok(result.Data));
        }