Beispiel #1
0
        public async Task ChangeRoleFuncsTest()
        {
            var addList = new List <string>()
            {
                "test", "test1"
            };
            // 测添加
            var addRes = await _perService.ChangeRoleFuncItems(UserContext.Identity.id, addList, null);

            Assert.True(addRes.IsSysOk());
            // 测删除
            var delRes = await _perService.ChangeRoleFuncItems(UserContext.Identity.id, null, addList);

            Assert.True(delRes.IsSysOk());
        }
Beispiel #2
0
        public Task <Resp> ChangeRoleFuncItems(long rid, [FromBody] ChangeRoleFuncItemsReq items)
        {
            if (rid <= 0 ||
                items == null ||
                !(items.add_items?.Count > 0 || items.delete_items?.Count > 0))
            {
                return(Task.FromResult(GetInvalidResp()));
            }

            return(_service.ChangeRoleFuncItems(rid, items.add_items, items.delete_items));
        }
Beispiel #3
0
        public Task <Resp> ChangeRoleFuncItems(string rid, [FromBody] ChangeRoleFuncItems items)
        {
            if (string.IsNullOrEmpty(rid) ||
                items == null ||
                !(items.add_items?.Count > 0 || items.delete_items?.Count > 0))
            {
                return(Task.FromResult(ParaErrorResp));
            }

            return(_service.ChangeRoleFuncItems(rid, items.add_items, items.delete_items));
        }