sample.processor.PermissionProcessor Maven / Gradle / Ivy
The newest version!
package sample.processor;
import com.envision.core.MarsProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import sample.domain.Permission;
import sample.model.PermissionHandler;
import java.util.List;
/**
* @author qiweishi
* @date 2018/11/9
*/
@Component
public class PermissionProcessor implements MarsProcessor {
@Autowired
private PermissionHandler permissionHandler;
@SuppressWarnings("unchecked")
@Override
public ResponseEntity> actor(Object... params) {
try {
List list = permissionHandler.execute("select * from permission");
return new ResponseEntity<>(list, HttpStatus.OK);
} catch (Exception e) {
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}