Search in sources :

Example 21 with PathVariable

use of org.springframework.web.bind.annotation.PathVariable in project scoold by Erudika.

the class ApiController method getPostRevisions.

@GetMapping("/posts/{id}/revisions")
public List<Map<String, Object>> getPostRevisions(@PathVariable String id, HttpServletRequest req, HttpServletResponse res) {
    Model model = new ExtendedModelMap();
    revisionsController.get(id, req, res, model);
    Post post = (Post) model.getAttribute("showPost");
    if (post == null) {
        res.setStatus(HttpStatus.NOT_FOUND.value());
        return null;
    }
    return ((List<Revision>) model.getAttribute("revisionslist")).stream().map(r -> {
        Map<String, Object> rev = new LinkedHashMap<>(ParaObjectUtils.getAnnotatedFields(r, false));
        rev.put("author", r.getAuthor());
        return rev;
    }).collect(Collectors.toList());
}
Also used : PathVariable(org.springframework.web.bind.annotation.PathVariable) Question(com.erudika.scoold.core.Question) Arrays(java.util.Arrays) RequestParam(org.springframework.web.bind.annotation.RequestParam) Webhook(com.erudika.para.core.Webhook) PeopleController(com.erudika.scoold.controllers.PeopleController) WebRequest(org.springframework.web.context.request.WebRequest) LoggerFactory(org.slf4j.LoggerFactory) ParaClient(com.erudika.para.client.ParaClient) Revision(com.erudika.scoold.core.Revision) StringUtils(org.apache.commons.lang3.StringUtils) Model(org.springframework.ui.Model) CommentController(com.erudika.scoold.controllers.CommentController) PutMapping(org.springframework.web.bind.annotation.PutMapping) Map(java.util.Map) Config(com.erudika.para.core.utils.Config) DeleteMapping(org.springframework.web.bind.annotation.DeleteMapping) ValidationUtils(com.erudika.para.core.validation.ValidationUtils) ScooldUtils(com.erudika.scoold.utils.ScooldUtils) PostMapping(org.springframework.web.bind.annotation.PostMapping) BadRequestException(com.erudika.scoold.utils.BadRequestException) ParaObject(com.erudika.para.core.ParaObject) QuestionsController(com.erudika.scoold.controllers.QuestionsController) Collection(java.util.Collection) Set(java.util.Set) StreamingResponseBody(org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody) UnapprovedQuestion(com.erudika.scoold.core.UnapprovedQuestion) Collectors(java.util.stream.Collectors) RestController(org.springframework.web.bind.annotation.RestController) REST_ENTITY_ATTRIBUTE(com.erudika.scoold.ScooldServer.REST_ENTITY_ATTRIBUTE) Comment(com.erudika.scoold.core.Comment) List(java.util.List) Tag(com.erudika.para.core.Tag) ReportsController(com.erudika.scoold.controllers.ReportsController) Optional(java.util.Optional) AUTH_USER_ATTRIBUTE(com.erudika.scoold.ScooldServer.AUTH_USER_ATTRIBUTE) ExtendedModelMap(org.springframework.ui.ExtendedModelMap) Sysprop(com.erudika.para.core.Sysprop) TagsController(com.erudika.scoold.controllers.TagsController) ParaObjectUtils(com.erudika.para.core.utils.ParaObjectUtils) RevisionsController(com.erudika.scoold.controllers.RevisionsController) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) HashMap(java.util.HashMap) Pager(com.erudika.para.core.utils.Pager) PatchMapping(org.springframework.web.bind.annotation.PatchMapping) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) Inject(javax.inject.Inject) AdminController(com.erudika.scoold.controllers.AdminController) HttpServletRequest(javax.servlet.http.HttpServletRequest) Locked(com.erudika.para.core.annotations.Locked) ExceptionHandler(org.springframework.web.bind.annotation.ExceptionHandler) GetMapping(org.springframework.web.bind.annotation.GetMapping) UnapprovedReply(com.erudika.scoold.core.UnapprovedReply) ProfileController(com.erudika.scoold.controllers.ProfileController) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) Post(com.erudika.scoold.core.Post) VoteController(com.erudika.scoold.controllers.VoteController) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) User(com.erudika.para.core.User) CONTEXT_PATH(com.erudika.scoold.ScooldServer.CONTEXT_PATH) Utils(com.erudika.para.core.utils.Utils) Report(com.erudika.scoold.core.Report) TimeUnit(java.util.concurrent.TimeUnit) HttpStatus(org.springframework.http.HttpStatus) ScooldServer(com.erudika.scoold.ScooldServer) NumberUtils(org.apache.commons.lang3.math.NumberUtils) QuestionController(com.erudika.scoold.controllers.QuestionController) Reply(com.erudika.scoold.core.Reply) MultipartFile(org.springframework.web.multipart.MultipartFile) ResponseEntity(org.springframework.http.ResponseEntity) Collections(java.util.Collections) Profile(com.erudika.scoold.core.Profile) ExtendedModelMap(org.springframework.ui.ExtendedModelMap) Post(com.erudika.scoold.core.Post) Model(org.springframework.ui.Model) List(java.util.List) Map(java.util.Map) ExtendedModelMap(org.springframework.ui.ExtendedModelMap) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 22 with PathVariable

use of org.springframework.web.bind.annotation.PathVariable in project scoold by Erudika.

the class ProfileController method get.

@GetMapping({ "", "/{id}/**" })
public String get(@PathVariable(required = false) String id, HttpServletRequest req, Model model) {
    if (!utils.isAuthenticated(req) && StringUtils.isBlank(id)) {
        return "redirect:" + SIGNINLINK + "?returnto=" + PROFILELINK;
    }
    Profile authUser = utils.getAuthUser(req);
    Profile showUser;
    boolean isMyProfile;
    if (StringUtils.isBlank(id) || isMyid(authUser, Profile.id(id))) {
        // requested userid !exists or = my userid => show my profile
        showUser = authUser;
        isMyProfile = true;
    } else {
        showUser = utils.getParaClient().read(Profile.id(id));
        isMyProfile = isMyid(authUser, Profile.id(id));
    }
    if (showUser == null || !ParaObjectUtils.typesMatch(showUser)) {
        return "redirect:" + PROFILELINK;
    }
    boolean protekted = !utils.isDefaultSpacePublic() && !utils.isAuthenticated(req);
    boolean sameSpace = (utils.canAccessSpace(showUser, "default") && utils.canAccessSpace(authUser, "default")) || (authUser != null && showUser.getSpaces().stream().anyMatch(s -> utils.canAccessSpace(authUser, s)));
    if (protekted || !sameSpace) {
        return "redirect:" + PEOPLELINK;
    }
    Pager itemcount1 = utils.getPager("page1", req);
    Pager itemcount2 = utils.getPager("page2", req);
    List<? extends Post> questionslist = getQuestions(authUser, showUser, isMyProfile, itemcount1);
    List<? extends Post> answerslist = getAnswers(authUser, showUser, isMyProfile, itemcount2);
    model.addAttribute("path", "profile.vm");
    model.addAttribute("title", utils.getLang(req).get("profile.title") + " - " + showUser.getName());
    model.addAttribute("description", getUserDescription(showUser, itemcount1.getCount(), itemcount2.getCount()));
    model.addAttribute("ogimage", avatarRepository.getLink(showUser, AvatarFormat.Profile));
    model.addAttribute("includeGMapsScripts", utils.isNearMeFeatureEnabled());
    model.addAttribute("showUser", showUser);
    model.addAttribute("isMyProfile", isMyProfile);
    model.addAttribute("badgesCount", showUser.getBadgesMap().size());
    model.addAttribute("canEdit", isMyProfile || canEditProfile(authUser, id));
    model.addAttribute("canEditAvatar", Config.getConfigBoolean("avatar_edits_enabled", true));
    model.addAttribute("gravatarPicture", gravatarAvatarGenerator.getLink(showUser, AvatarFormat.Profile));
    model.addAttribute("isGravatarPicture", gravatarAvatarGenerator.isLink(showUser.getPicture()));
    model.addAttribute("itemcount1", itemcount1);
    model.addAttribute("itemcount2", itemcount2);
    model.addAttribute("questionslist", questionslist);
    model.addAttribute("answerslist", answerslist);
    model.addAttribute("nameEditsAllowed", Config.getConfigBoolean("name_edits_enabled", true));
    return "base";
}
Also used : PathVariable(org.springframework.web.bind.annotation.PathVariable) RequestParam(org.springframework.web.bind.annotation.RequestParam) SIGNINLINK(com.erudika.scoold.ScooldServer.SIGNINLINK) Question(com.erudika.scoold.core.Question) ParaObjectUtils(com.erudika.para.core.utils.ParaObjectUtils) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Pager(com.erudika.para.core.utils.Pager) Controller(org.springframework.stereotype.Controller) StringUtils(org.apache.commons.lang3.StringUtils) ArrayList(java.util.ArrayList) Badge(com.erudika.scoold.core.Profile.Badge) Inject(javax.inject.Inject) HttpServletRequest(javax.servlet.http.HttpServletRequest) Model(org.springframework.ui.Model) MODS(com.erudika.para.core.User.Groups.MODS) com.erudika.scoold.utils.avatars(com.erudika.scoold.utils.avatars) GetMapping(org.springframework.web.bind.annotation.GetMapping) Config(com.erudika.para.core.utils.Config) ScooldUtils(com.erudika.scoold.utils.ScooldUtils) PostMapping(org.springframework.web.bind.annotation.PostMapping) PEOPLELINK(com.erudika.scoold.ScooldServer.PEOPLELINK) Post(com.erudika.scoold.core.Post) HttpServletResponse(javax.servlet.http.HttpServletResponse) PROFILELINK(com.erudika.scoold.ScooldServer.PROFILELINK) User(com.erudika.para.core.User) Utils(com.erudika.para.core.utils.Utils) List(java.util.List) USERS(com.erudika.para.core.User.Groups.USERS) Reply(com.erudika.scoold.core.Reply) Profile(com.erudika.scoold.core.Profile) Pager(com.erudika.para.core.utils.Pager) Profile(com.erudika.scoold.core.Profile) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 23 with PathVariable

use of org.springframework.web.bind.annotation.PathVariable in project ontrack by nemerosa.

the class ProjectEntityExtensionController method getInformation.

/**
 * Gets the list of information extensions for an entity
 */
@RequestMapping(value = "information/{entityType}/{id}", method = RequestMethod.GET)
public Resources<EntityInformation> getInformation(@PathVariable ProjectEntityType entityType, @PathVariable ID id) {
    // Gets the entity
    ProjectEntity entity = getEntity(entityType, id);
    // List of informations to return
    List<EntityInformation> informations = extensionManager.getExtensions(EntityInformationExtension.class).stream().map(x -> x.getInformation(entity)).filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
    // OK
    return Resources.of(informations, uri(MvcUriComponentsBuilder.on(getClass()).getInformation(entityType, id)));
}
Also used : EntityInformationExtension(net.nemerosa.ontrack.extension.api.EntityInformationExtension) PathVariable(org.springframework.web.bind.annotation.PathVariable) EntityInformation(net.nemerosa.ontrack.extension.api.model.EntityInformation) StructureService(net.nemerosa.ontrack.model.structure.StructureService) Autowired(org.springframework.beans.factory.annotation.Autowired) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) Action(net.nemerosa.ontrack.model.support.Action) RestController(org.springframework.web.bind.annotation.RestController) Collectors(java.util.stream.Collectors) ProjectEntityType(net.nemerosa.ontrack.model.structure.ProjectEntityType) ProjectEntityActionExtension(net.nemerosa.ontrack.extension.api.ProjectEntityActionExtension) List(java.util.List) Resources(net.nemerosa.ontrack.ui.resource.Resources) MvcUriComponentsBuilder(org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder) EntityInformationExtension(net.nemerosa.ontrack.extension.api.EntityInformationExtension) ProjectEntity(net.nemerosa.ontrack.model.structure.ProjectEntity) Optional(java.util.Optional) ExtensionManager(net.nemerosa.ontrack.extension.api.ExtensionManager) ID(net.nemerosa.ontrack.model.structure.ID) Optional(java.util.Optional) ProjectEntity(net.nemerosa.ontrack.model.structure.ProjectEntity) EntityInformation(net.nemerosa.ontrack.extension.api.model.EntityInformation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 24 with PathVariable

use of org.springframework.web.bind.annotation.PathVariable in project CzechIdMng by bcvsolutions.

the class SysRemoteServerController method getConnectorTypes.

/**
 * Returns connector types registered on given remote server.
 *
 * @return connector types
 */
@ResponseBody
@RequestMapping(method = RequestMethod.GET, value = "/{backendId}/connector-types")
@PreAuthorize("hasAuthority('" + AccGroupPermission.REMOTESERVER_READ + "')")
@ApiOperation(value = "Get supported connector types", nickname = "getConnectorTypes", tags = { SysRemoteServerController.TAG }, authorizations = { @Authorization(value = SwaggerConfig.AUTHENTICATION_BASIC, scopes = { @AuthorizationScope(scope = AccGroupPermission.REMOTESERVER_READ, description = "") }), @Authorization(value = SwaggerConfig.AUTHENTICATION_CIDMST, scopes = { @AuthorizationScope(scope = AccGroupPermission.REMOTESERVER_READ, description = "") }) })
public Resources<ConnectorTypeDto> getConnectorTypes(@ApiParam(value = "Remote server uuid identifier or code.", required = true) @PathVariable @NotNull String backendId) {
    SysConnectorServerDto connectorServer = getDto(backendId);
    if (connectorServer == null) {
        throw new EntityNotFoundException(getService().getEntityClass(), backendId);
    }
    // 
    try {
        List<IcConnectorInfo> connectorInfos = Lists.newArrayList();
        for (IcConfigurationService config : icConfiguration.getIcConfigs().values()) {
            connectorServer.setPassword(remoteServerService.getPassword(connectorServer.getId()));
            Set<IcConnectorInfo> availableRemoteConnectors = config.getAvailableRemoteConnectors(connectorServer);
            if (CollectionUtils.isNotEmpty(availableRemoteConnectors)) {
                connectorInfos.addAll(availableRemoteConnectors);
            }
        }
        // Find connector types for existing connectors.
        List<ConnectorTypeDto> connectorTypes = connectorManager.getSupportedTypes().stream().filter(connectorType -> {
            return connectorInfos.stream().anyMatch(connectorInfo -> connectorType.getConnectorName().equals(connectorInfo.getConnectorKey().getConnectorName()));
        }).map(connectorType -> {
            // Find connector info and set version to the connectorTypeDto.
            IcConnectorInfo info = connectorInfos.stream().filter(connectorInfo -> connectorType.getConnectorName().equals(connectorInfo.getConnectorKey().getConnectorName())).findFirst().orElse(null);
            ConnectorTypeDto connectorTypeDto = connectorManager.convertTypeToDto(connectorType);
            connectorTypeDto.setLocal(true);
            if (info != null) {
                connectorTypeDto.setVersion(info.getConnectorKey().getBundleVersion());
                connectorTypeDto.setName(info.getConnectorDisplayName());
            }
            return connectorTypeDto;
        }).collect(Collectors.toList());
        // Find connectors without extension (specific connector type).
        List<ConnectorTypeDto> defaultConnectorTypes = connectorInfos.stream().map(info -> {
            ConnectorTypeDto connectorTypeDto = connectorManager.convertIcConnectorInfoToDto(info);
            connectorTypeDto.setLocal(true);
            return connectorTypeDto;
        }).filter(type -> {
            return !connectorTypes.stream().anyMatch(supportedType -> supportedType.getConnectorName().equals(type.getConnectorName()) && supportedType.isHideParentConnector());
        }).collect(Collectors.toList());
        connectorTypes.addAll(defaultConnectorTypes);
        return new Resources<>(connectorTypes.stream().sorted(Comparator.comparing(ConnectorTypeDto::getOrder)).collect(Collectors.toList()));
    } catch (IcInvalidCredentialException e) {
        throw new ResultCodeException(AccResultCode.REMOTE_SERVER_INVALID_CREDENTIAL, ImmutableMap.of("server", e.getHost() + ":" + e.getPort()), e);
    } catch (IcServerNotFoundException e) {
        throw new ResultCodeException(AccResultCode.REMOTE_SERVER_NOT_FOUND, ImmutableMap.of("server", e.getHost() + ":" + e.getPort()), e);
    } catch (IcCantConnectException e) {
        throw new ResultCodeException(AccResultCode.REMOTE_SERVER_CANT_CONNECT, ImmutableMap.of("server", e.getHost() + ":" + e.getPort()), e);
    } catch (IcRemoteServerException e) {
        throw new ResultCodeException(AccResultCode.REMOTE_SERVER_UNEXPECTED_ERROR, ImmutableMap.of("server", e.getHost() + ":" + e.getPort()), e);
    }
}
Also used : PathVariable(org.springframework.web.bind.annotation.PathVariable) RequestParam(org.springframework.web.bind.annotation.RequestParam) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) IcRemoteServerException(eu.bcvsolutions.idm.ic.exception.IcRemoteServerException) Autowired(org.springframework.beans.factory.annotation.Autowired) Enabled(eu.bcvsolutions.idm.core.security.api.domain.Enabled) ApiParam(io.swagger.annotations.ApiParam) SysConnectorServerDto(eu.bcvsolutions.idm.acc.dto.SysConnectorServerDto) IcInvalidCredentialException(eu.bcvsolutions.idm.ic.exception.IcInvalidCredentialException) Valid(javax.validation.Valid) ApiOperation(io.swagger.annotations.ApiOperation) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) Map(java.util.Map) SysRemoteServerService(eu.bcvsolutions.idm.acc.service.api.SysRemoteServerService) Pageable(org.springframework.data.domain.Pageable) AuthorizationScope(io.swagger.annotations.AuthorizationScope) IcCantConnectException(eu.bcvsolutions.idm.ic.exception.IcCantConnectException) IcConfigurationFacade(eu.bcvsolutions.idm.ic.service.api.IcConfigurationFacade) EntityNotFoundException(eu.bcvsolutions.idm.core.api.exception.EntityNotFoundException) ImmutableMap(com.google.common.collect.ImmutableMap) MediaType(org.springframework.http.MediaType) Set(java.util.Set) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) NotNull(javax.validation.constraints.NotNull) Collectors(java.util.stream.Collectors) RestController(org.springframework.web.bind.annotation.RestController) List(java.util.List) ConnectorManager(eu.bcvsolutions.idm.acc.service.api.ConnectorManager) IcConnectorInfo(eu.bcvsolutions.idm.ic.api.IcConnectorInfo) SysRemoteServerFilter(eu.bcvsolutions.idm.acc.dto.filter.SysRemoteServerFilter) AccResultCode(eu.bcvsolutions.idm.acc.domain.AccResultCode) ResultModels(eu.bcvsolutions.idm.core.api.dto.ResultModels) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) HashMap(java.util.HashMap) CollectionUtils(org.apache.commons.collections4.CollectionUtils) RequestBody(org.springframework.web.bind.annotation.RequestBody) HttpServletRequest(javax.servlet.http.HttpServletRequest) Lists(com.google.common.collect.Lists) AbstractReadWriteDtoController(eu.bcvsolutions.idm.core.api.rest.AbstractReadWriteDtoController) SwaggerConfig(eu.bcvsolutions.idm.core.api.config.swagger.SwaggerConfig) AccGroupPermission(eu.bcvsolutions.idm.acc.domain.AccGroupPermission) IcConfigurationService(eu.bcvsolutions.idm.ic.service.api.IcConfigurationService) ConnectorTypeDto(eu.bcvsolutions.idm.acc.dto.ConnectorTypeDto) Api(io.swagger.annotations.Api) AccModuleDescriptor(eu.bcvsolutions.idm.acc.AccModuleDescriptor) IcServerNotFoundException(eu.bcvsolutions.idm.ic.exception.IcServerNotFoundException) MultiValueMap(org.springframework.util.MultiValueMap) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) HttpMessageNotReadableException(org.springframework.http.converter.HttpMessageNotReadableException) HttpStatus(org.springframework.http.HttpStatus) IdmBulkActionDto(eu.bcvsolutions.idm.core.api.bulk.action.dto.IdmBulkActionDto) BaseController(eu.bcvsolutions.idm.core.api.rest.BaseController) BaseDtoController(eu.bcvsolutions.idm.core.api.rest.BaseDtoController) PageableDefault(org.springframework.data.web.PageableDefault) Resources(org.springframework.hateoas.Resources) ResponseEntity(org.springframework.http.ResponseEntity) Comparator(java.util.Comparator) Authorization(io.swagger.annotations.Authorization) IcServerNotFoundException(eu.bcvsolutions.idm.ic.exception.IcServerNotFoundException) IcInvalidCredentialException(eu.bcvsolutions.idm.ic.exception.IcInvalidCredentialException) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) EntityNotFoundException(eu.bcvsolutions.idm.core.api.exception.EntityNotFoundException) ConnectorTypeDto(eu.bcvsolutions.idm.acc.dto.ConnectorTypeDto) IcConnectorInfo(eu.bcvsolutions.idm.ic.api.IcConnectorInfo) IcConfigurationService(eu.bcvsolutions.idm.ic.service.api.IcConfigurationService) IcCantConnectException(eu.bcvsolutions.idm.ic.exception.IcCantConnectException) IcRemoteServerException(eu.bcvsolutions.idm.ic.exception.IcRemoteServerException) Resources(org.springframework.hateoas.Resources) SysConnectorServerDto(eu.bcvsolutions.idm.acc.dto.SysConnectorServerDto) ApiOperation(io.swagger.annotations.ApiOperation) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 25 with PathVariable

use of org.springframework.web.bind.annotation.PathVariable in project zhcet-web by zhcet-amu.

the class CoursesController method getCourses.

@GetMapping
public String getCourses(Model model, @PathVariable Department department, @RequestParam(value = "all", required = false) Boolean all) {
    ErrorUtils.requireNonNullDepartment(department);
    // Determine if only active courses have to be should
    boolean active = !(all != null && all);
    model.addAttribute("page_description", "View and manage courses for the Department");
    model.addAttribute("department", department);
    model.addAttribute("page_title", "Courses : " + department.getName() + " Department");
    model.addAttribute("page_subtitle", "Course Management");
    model.addAttribute("page_path", getPath(department));
    model.addAttribute("all", !active);
    List<FloatedCourse> floatedCourses = floatedCourseService.getCurrentFloatedCourses(department);
    List<Course> courses = courseService.getAllActiveCourse(department, active);
    // Add meta tag and no of registrations to each course
    for (FloatedCourse floatedCourse : floatedCourses) {
        Stream.of(floatedCourse).map(FloatedCourse::getCourse).map(courses::indexOf).filter(index -> index != -1).map(courses::get).findFirst().ifPresent(course -> {
            course.setMeta("Floated");
            course.setRegistrations(floatedCourse.getCourseRegistrations().size());
        });
    }
    SortUtils.sortCourses(courses);
    model.addAttribute("courses", courses);
    return "department/courses";
}
Also used : PathVariable(org.springframework.web.bind.annotation.PathVariable) RequestParam(org.springframework.web.bind.annotation.RequestParam) PathChain(amu.zhcet.common.page.PathChain) Department(amu.zhcet.data.department.Department) Autowired(org.springframework.beans.factory.annotation.Autowired) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Controller(org.springframework.stereotype.Controller) CourseService(amu.zhcet.data.course.CourseService) Course(amu.zhcet.data.course.Course) ErrorUtils(amu.zhcet.core.error.ErrorUtils) Slf4j(lombok.extern.slf4j.Slf4j) Model(org.springframework.ui.Model) List(java.util.List) FloatedCourse(amu.zhcet.data.course.floated.FloatedCourse) Stream(java.util.stream.Stream) Path(amu.zhcet.common.page.Path) SortUtils(amu.zhcet.common.utils.SortUtils) GetMapping(org.springframework.web.bind.annotation.GetMapping) DepartmentController(amu.zhcet.core.admin.department.DepartmentController) Comparator(java.util.Comparator) FloatedCourseService(amu.zhcet.data.course.floated.FloatedCourseService) FloatedCourse(amu.zhcet.data.course.floated.FloatedCourse) Course(amu.zhcet.data.course.Course) FloatedCourse(amu.zhcet.data.course.floated.FloatedCourse) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

PathVariable (org.springframework.web.bind.annotation.PathVariable)83 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)65 List (java.util.List)61 RequestParam (org.springframework.web.bind.annotation.RequestParam)54 Collectors (java.util.stream.Collectors)50 RequestMethod (org.springframework.web.bind.annotation.RequestMethod)48 RestController (org.springframework.web.bind.annotation.RestController)44 Autowired (org.springframework.beans.factory.annotation.Autowired)43 RequestBody (org.springframework.web.bind.annotation.RequestBody)42 MediaType (org.springframework.http.MediaType)40 ApiOperation (io.swagger.annotations.ApiOperation)37 HttpStatus (org.springframework.http.HttpStatus)33 IOException (java.io.IOException)32 Set (java.util.Set)29 ApiParam (io.swagger.annotations.ApiParam)27 HttpServletResponse (javax.servlet.http.HttpServletResponse)27 Map (java.util.Map)26 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)26 ResponseEntity (org.springframework.http.ResponseEntity)25 GetMapping (org.springframework.web.bind.annotation.GetMapping)24