Exemplo n.º 1
0
        public async Task <IActionResult> GetAllTemplate([FromBody] GetDataDTO dto)
        {
            try
            {
                var res = await _tempMgr.GetAllTemplate(dto.offset, dto.limit, GetSiteID, dto.keywords, dto.category, false);

                return(new ObjectResult(res));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetAllCategory([FromBody] GetDataDTO dto)
        {
            try
            {
                var res = await _tempMgr.GetCategoryList(dto.offset, dto.limit, GetSiteID);

                return(new ObjectResult(res));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 3
0
    public IEnumerator GetData()
    {
        var contractAddress         = "0x786a30e1ab0c58303c85419b9077657ad4fdb0ea";
        var url                     = "http://*****:*****@"[{ 'constant':false,'inputs':[],'name':'getData','outputs':[{'name':'birthTime','type':'uint64'},{'name':'userName','type':'string'},{'name':'starterId','type':'uint16'},{'name':'currLocation','type':'uint16'},{'name':'isBusy','type':'bool'},{'name':'owner','type':'address'}],'payable':false,'stateMutability':'nonpayable','type':'function'}]", contractAddress);
        var function                = contract.GetFunction("getData");
        var callInput               = function.CreateCallInput();

        yield return(getDataCallUnityRequest.SendRequest(callInput, Nethereum.RPC.Eth.DTOs.BlockParameter.CreateLatest()));

        var result = getDataCallUnityRequest.Result;
        var thing  = new GetDataDTO();
        var output = function.DecodeDTOTypeOutput <GetDataDTO>(thing, result);

        Debug.Log("birth block " + output.BirthTime);
        Debug.Log("curr location " + output.CurrLocation);
        Debug.Log("busy" + output.IsBusy);
        Debug.Log("starterid " + output.StarterId);
        Debug.Log("userName " + output.UserName);
        Debug.Log("ownerAddress " + output.Owner);
    }