Search in sources :

Example 1 with UserActionAndModel

use of com.infiniteautomation.mango.rest.latest.model.user.UserActionAndModel in project ma-modules-public by infiniteautomation.

the class UserRestController method queryCsvPost.

@ApiOperation(value = "Gets a list of users for bulk import via CSV", notes = "Adds an additional action and originalXid column")
@RequestMapping(method = RequestMethod.POST, value = "/query", produces = MediaTypes.CSV_VALUE)
public StreamedArrayWithTotal queryCsvPost(@ApiParam(value = "RQL query AST", required = true) @RequestBody ASTNode rql, @AuthenticationPrincipal PermissionHolder user) {
    return doQuery(rql, user, userModel -> {
        UserActionAndModel actionAndModel = new UserActionAndModel();
        actionAndModel.setAction(VoAction.UPDATE);
        actionAndModel.setOriginalUsername(userModel.getUsername());
        actionAndModel.setModel(userModel);
        return actionAndModel;
    });
}
Also used : UserActionAndModel(com.infiniteautomation.mango.rest.latest.model.user.UserActionAndModel) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

UserActionAndModel (com.infiniteautomation.mango.rest.latest.model.user.UserActionAndModel)1 ApiOperation (io.swagger.annotations.ApiOperation)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1