How to use the midway-web.post function in midway-web

To help you get started, we’ve selected a few midway-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github midwayjs / sandbox / packages / sandbox-core / src / app / controller / applicationCtrl.ts View on Github external
@get('/groupExist')
  async groupExist(ctx) {
    const query = ctx.query;
    const data = await this.applicationService.groupExist(query);
    ctx.body = wrapJson(data);
  }

  @post('/groupUpsert')
  async groupUpsert(ctx) {
    const body = ctx.request.body;
    const data = await this.applicationService.groupUpsert(body);
    ctx.body = wrapJson(data);
  }

  @post('/groupDelete')
  async groupDelete(ctx) {
    const body = ctx.request.body;
    const data = await this.applicationService.groupDelete(body);
    ctx.body = wrapJson(data);
  }

}
github midwayjs / sandbox / packages / sandbox-core / src / app / controller / applicationCtrl.ts View on Github external
@get('/queryHosts')
  async queryHosts(ctx) {
    const query = ctx.query;
    const data = await this.applicationService.queryHosts(query);
    ctx.body = wrapJson(data);
  }

  @get('/groupExist')
  async groupExist(ctx) {
    const query = ctx.query;
    const data = await this.applicationService.groupExist(query);
    ctx.body = wrapJson(data);
  }

  @post('/groupUpsert')
  async groupUpsert(ctx) {
    const body = ctx.request.body;
    const data = await this.applicationService.groupUpsert(body);
    ctx.body = wrapJson(data);
  }

  @post('/groupDelete')
  async groupDelete(ctx) {
    const body = ctx.request.body;
    const data = await this.applicationService.groupDelete(body);
    ctx.body = wrapJson(data);
  }

}
github midwayjs / sandbox / packages / sandbox-core / src / app / controller / tracingCtrl.ts View on Github external
@get('/listFocusTraces')
  async focusTraces(ctx) {
    const query = ctx.query;
    const result = await this.traceService.listFocusTraces(query);
    ctx.body = wrapJson(result);
  }

  @get('/listTraces')
  async traces(ctx) {
    const query = ctx.query;
    const result = await this.traceService.listTraces(query);
    ctx.body = wrapJson(result);
  }

  @post('/toggleFocus')
  async toggleFocus(ctx) {
    const body = ctx.request.body;
    const result = await this.traceService.toggleTraceFocus(body);
    ctx.body = wrapJson(result);
  }

  @get('/traceDetail')
  async traceDetail(ctx) {
    const query = ctx.query;
    const result = await this.traceService.traceDetail(query);
    ctx.body = wrapJson(result);
  }

  @get('/traceTotalitySummary')
  async traceTotality(ctx) {
    const query = ctx.query;