| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.pojo.AuthApi; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.PersonDto; |
| | | import com.yuanchu.mom.pojo.Company; |
| | | import com.yuanchu.mom.service.UserService; |
| | | import com.yuanchu.mom.util.HeaderToken; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.Authorization; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/companies") |
| | | @Api("组织模块") |
| | | @Api(tags="用户模块") |
| | | public class CompaniesController { |
| | | |
| | | @Autowired |
| | | private HeaderToken headerToken; |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "获取组织列表") |
| | | private UserService userService; |
| | | |
| | | @ValueClassify("用户管理") |
| | | @ApiOperation(value = "获取人事系统组织架构") |
| | | @GetMapping(value = "/selectCompaniesList") |
| | | public Result<List<Company>> selectcompaniesList(){ |
| | | public Result<List<Company>> selectCompaniesList() { |
| | | return Result.success(headerToken.companyUrl()); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation("获取人事系统组织下的人员") |
| | | @PostMapping(value = "/selectSimpleList") |
| | | public Result<?> selectSimpleList(String companyId) { |
| | | return Result.success(headerToken.userUrl(companyId)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation("将人事系统勾选的内容转移到本系统") |
| | | @PostMapping(value = "/addPersonUser") |
| | | public Result<?> addPersonUser(@RequestBody PersonDto personDto) { |
| | | return Result.success(userService.addPersonUser(personDto)); |
| | | } |
| | | |
| | | } |