Search in sources :

Example 31 with GetMapping

use of org.springframework.web.bind.annotation.GetMapping in project tesla by linking12.

the class MenuController method edit.

@Log("编辑菜单")
@RequiresPermissions("sys:menu:edit")
@GetMapping("/edit/{id}")
String edit(Model model, @PathVariable("id") Long id) {
    MenuDO mdo = menuService.get(id);
    Long pId = mdo.getParentId();
    model.addAttribute("pId", pId);
    if (pId == 0) {
        model.addAttribute("pName", "根目录");
    } else {
        model.addAttribute("pName", menuService.get(pId).getName());
    }
    model.addAttribute("menu", mdo);
    return prefix + "/edit";
}
Also used : MenuDO(io.github.tesla.ops.system.domain.MenuDO) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) GetMapping(org.springframework.web.bind.annotation.GetMapping) Log(io.github.tesla.ops.common.Log)

Example 32 with GetMapping

use of org.springframework.web.bind.annotation.GetMapping in project tesla by linking12.

the class Oauth2Controller method listTokens.

@ResponseBody
@GetMapping("/listToken")
@RequiresPermissions("sys:oauth2:listToken")
PageDO<AccessToken> listTokens(@RequestParam Map<String, Object> params) {
    Query query = new Query(params);
    PageDO<AccessToken> page = oauth2Service.queryTokenList(query);
    return page;
}
Also used : Query(io.github.tesla.ops.utils.Query) AccessToken(io.github.tesla.authz.domain.AccessToken) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) GetMapping(org.springframework.web.bind.annotation.GetMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 33 with GetMapping

use of org.springframework.web.bind.annotation.GetMapping in project tesla by linking12.

the class UserController method list.

@GetMapping("/list")
@ResponseBody
Pageable list(@RequestParam Map<String, Object> params) {
    // 查询列表数据
    Query query = new Query(params);
    List<UserDO> sysUserList = userService.list(query);
    int total = userService.count(query);
    Pageable pageUtil = new Pageable(sysUserList, total);
    return pageUtil;
}
Also used : Pageable(io.github.tesla.ops.common.Pageable) Query(io.github.tesla.ops.utils.Query) UserDO(io.github.tesla.ops.system.domain.UserDO) GetMapping(org.springframework.web.bind.annotation.GetMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 34 with GetMapping

use of org.springframework.web.bind.annotation.GetMapping in project tesla by linking12.

the class UserController method edit.

@RequiresPermissions("sys:user:edit")
@Log("编辑用户")
@GetMapping("/edit/{id}")
String edit(Model model, @PathVariable("id") Long id) {
    UserDO userDO = userService.get(id);
    model.addAttribute("user", userDO);
    List<RoleDO> roles = roleService.list(id);
    model.addAttribute("roles", roles);
    return prefix + "/edit";
}
Also used : UserDO(io.github.tesla.ops.system.domain.UserDO) RoleDO(io.github.tesla.ops.system.domain.RoleDO) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) GetMapping(org.springframework.web.bind.annotation.GetMapping) Log(io.github.tesla.ops.common.Log)

Example 35 with GetMapping

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

the class StudentAttendanceController method attendance.

@GetMapping
public String attendance(Model model) {
    Student student = studentService.getLoggedInStudent().orElseThrow(StudentNotFoundException::new);
    model.addAttribute("page_title", "Attendance");
    model.addAttribute("page_subtitle", "Attendance Panel for " + student.getEnrolmentNumber() + " | " + student.getUser().getName());
    model.addAttribute("page_description", "View attendance of floated courses this session");
    model.addAttribute("attendances", attendanceService.getAttendanceByStudent(student));
    return "student/attendance";
}
Also used : StudentNotFoundException(amu.zhcet.data.user.student.StudentNotFoundException) Student(amu.zhcet.data.user.student.Student) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

GetMapping (org.springframework.web.bind.annotation.GetMapping)737 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)114 ResponseEntity (org.springframework.http.ResponseEntity)78 ArrayList (java.util.ArrayList)52 ModelAndView (org.springframework.web.servlet.ModelAndView)48 List (java.util.List)46 WebMessageException (org.hisp.dhis.dxf2.webmessage.WebMessageException)45 HttpHeaders (org.springframework.http.HttpHeaders)40 HashMap (java.util.HashMap)38 lombok.val (lombok.val)38 Map (java.util.Map)37 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)36 Grid (org.hisp.dhis.common.Grid)35 IOException (java.io.IOException)32 ApiOperation (io.swagger.annotations.ApiOperation)31 RootNode (org.hisp.dhis.node.types.RootNode)31 RequestParam (org.springframework.web.bind.annotation.RequestParam)31 PathVariable (org.springframework.web.bind.annotation.PathVariable)30 HttpServletRequest (javax.servlet.http.HttpServletRequest)29 FieldFilterParams (org.hisp.dhis.fieldfilter.FieldFilterParams)28