buaziz的活动

  • ABP Framework version: v2.9
  • UI type: Angular
  • Identity Server Seperated (Angular)
  • Steps to reproduce the issue:
  1. Create new AppService
  2. Add GetList Method
  3. Angular client : Generate proxy - abp generate-proxy

Issue: I have a simple app service with one method but the generated proxy for the output DTO is incorrect.

AppService Method

   public virtual async Task<PagedResultDto<CampaignDto>> GetCampaignListAsync(GetCampaignsInput input)
        {

            var totalCount = await _campaignRepository.GetCountAsync(input.FilterText, input.Name);
            var items = await _campaignRepository.GetListAsync(input.FilterText, input.Name, input.Sorting, input.MaxResultCount, input.SkipCount, false);

            return new PagedResultDto<CampaignDto>
            {
                TotalCount = totalCount,
                Items = ObjectMapper.Map<List<Campaign>, List<CampaignDto>>(items)
            };
        }

Here is the problem>> Generated Proxy (incorrect)


import { ListResultDto } from '@abp/ng.core';

export class CampaignDto extends ListResultDto<ACME.Campaigns.CampaignDto> {
  totalCount: number;
  items: any[];

  constructor(initialValues: Partial<CampaignDto> = {}) {
    super(initialValues);
  }
}

Generated Service (correct)

import { RestService , PagedResultDto} from '@abp/ng.core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import {GetCampaignsInput, CampaignDto} from '../models';

@Injectable({providedIn: 'root'})
export class CampaignService {
  apiName = 'Default';

  constructor(private restService: RestService) {}

 getCampaignListByInput(params = {} as GetCampaignsInput): Observable<PagedResultDto<CampaignDto>> {
   return this.restService.request({ url: '/api/app/campaign/campaignList', method: 'GET', params },{ apiName: this.apiName });
 }
}

DTO Class

namespace ACME.Campaigns
{
    public class CampaignDto : AuditedEntityDto<Guid>
    {
        public string Name { get; set; }     
    }
}

ok thanks,

hi alper,

this os a question.

i want to confirm if the above can be accomplished now.? or in a future update.

Thanks.. will wait..

I have another posted question for you https://support.abp.io/QA/Questions/268/General-Question--How-to-accomblish-a-touch-free-upgrade-in-the-future

using the new modular system of abp can the below be accomblished?

  • a [Main Solution] : Create a new solution and customize non coded seetings (ex: appsettings.json) and never touch it again until the next abp upgrade
  • a [Module 1 Solution] : Create module solution and develop the custom parts of my app on that solution
  • Debug and test on [Module 1 Solution] IdentiyTables and Abp Tables content and [Module 1 Solution] Custom Tables
  • Add References of [Module 1 Solution] to [Main Solution] then Debug and test on [Main Solution] IdentiyTables and Abp Tables content and [Module 1 Solution] Custom Tables

thank would be great :)

Dears,

are you planning an Angular Module Startup template ?

I can only see that you have an MVC one here : https://docs.abp.io/en/abp/latest/Startup-Templates/Module

显示 26 个条目中的 21 到 26 个.
Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11