Open Closed

How can we prevent an API/Controller/Service to not generate as service in Angular application? #7033


User avatar
0
sandeep.step2gen@gmail.com created
  • ABP Framework version: v7.3.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

How can we prevent an API/Controller/Service to not generate as service in Angular application when run abp generate-proxy -t ng ?


11 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    CLI will generate a proxy script with the module name app by default.

    You can use different module name for your API to avoid generating proxies:

    [RemoteService(Name = "myapp")]
    [Area("myapp")]
    [Route("api/test")]
    public class TestController : AbpControllerBase, ITestAppService
    {
      ....
    }
    
  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    No, I want to ignore only one particular API, like this method I want to be avoid

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Unfortunately, there is currently no way to ignore it. you may need to delete it manually

  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    then we need to do that every time, right?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Yes, it will be a bit troublesome

    I suggest you move the method to a new API controller and use different module name

  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    btw about the proxy now we are getting this issue, after adding IRemoteStreamContent in the Dto

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    The problem should be fixed in the next CLI version.

  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    So also we can not use IFormFile, is that right?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    yes, You should use IRemoteStreamContent

  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    then How can we call this API with POSTMAN?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    It's no different than IFormFile

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38