| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Userinfo |
| | | import cn.flightfeather.supervision.lightshare.service.UserinfoService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | | import org.springframework.web.bind.annotation.* |
| | | |
| | | @Api(tags = ["UserinfoController"], description = "用户信息API接口") |
| | |
| | | @GetMapping("/{id}") |
| | | fun getById(@PathVariable id: String) = userinfoService.findOne(id) |
| | | |
| | | @ApiOperation(value = "按用户类型搜索用户信息") |
| | | @GetMapping("/type/get") |
| | | fun getUserByTypeId(@RequestParam typeId: Byte) = userinfoService.findByType(typeId) |
| | | fun getUserByTypeId( |
| | | @ApiParam("用户类型id") @RequestParam typeId: Byte, |
| | | @ApiParam("用户是否可用", required = false, defaultValue = "true") @RequestParam(required = false) enable: Boolean? |
| | | ) = userinfoService.findByType(typeId, enable) |
| | | |
| | | @PutMapping("") |
| | | fun add(@RequestBody userinfo: Userinfo) = userinfoService.save(userinfo) |
| | |
| | | @DeleteMapping("/{id}") |
| | | fun delete(@PathVariable id: String) = userinfoService.delete(id) |
| | | |
| | | @ApiOperation(value = "模糊搜索用户信息") |
| | | @PostMapping("/search") |
| | | fun search( |
| | | @ApiParam("区域条件信息") @RequestBody |
| | | areaVo: AreaVo, |
| | | @ApiParam("搜索关键字,匹配用户账户名和昵称") @RequestParam |
| | | keyword: String, |
| | | @ApiParam("用户类型", example = "0:管理员;1:内部人员;2:政府部门;3:企业", defaultValue = "3", required = false) |
| | | @RequestParam(required = false) |
| | | userType: Int?, |
| | | @ApiParam("查询页码", defaultValue = "1", required = false) @RequestParam("page", required = false) |
| | | page: Int?, |
| | | @ApiParam("单页数据量", defaultValue = "30", required = false) @RequestParam("per_page", required = false) |
| | | perPage: Int?, |
| | | ) = resPack { userinfoService.search(areaVo, keyword, userType, page, perPage) } |
| | | |
| | | @PostMapping("/login") |
| | | fun getByName(@RequestBody userinfo: Userinfo) = userinfoService.findOneByName(userinfo) |
| | | |