Newer
Older
huludao / src / main / java / com / newfiber / api / pc / controller / RestTemplateController.java
package com.newfiber.api.pc.controller;

import com.newfiber.api.pc.dao.Data_Role_OrgDao;
import com.newfiber.api.pc.dao.Data_User_InfoDao;
import com.newfiber.api.pc.dao.Data_User_OrgDao;
import com.newfiber.api.pc.dao.SysJurisdictionDao;
import com.newfiber.api.pc.dao.Sys_OrganizationDao;
import com.newfiber.api.pc.dao.Sys_RolesDao;
import com.newfiber.api.pc.model.entity.Data_User_Info;
import com.newfiber.api.pc.model.entity.SysOrganization;
import com.newfiber.api.pc.model.entity.Sys_Roles;
import com.newfiber.api.pc.model.entity.UserInfo;
import com.newfiber.api.pc.model.entity.Users;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "RestTemplate接口管理", hidden = true)
@RestController
@RequestMapping(value = "/rest_template")
public class RestTemplateController {

    @Resource
    private Data_User_InfoDao userInfoDao;

    @Resource
    private Data_User_OrgDao UserOrgDao;

    @Autowired
    private Sys_RolesDao sysRoleDao;

    @Autowired
    private Data_Role_OrgDao roleOrgDao;

    @Autowired
    private Sys_OrganizationDao organizationDao;

    @ApiOperation(value = "获取用户信息")
    @PostMapping(value = "/user/get_user_info")
    public Data_User_Info getUserInfo(@RequestParam("userNo") String userNo){
        return userInfoDao.GetLogin(userNo);
    }

    @ApiOperation(value = "根据用户编号查询组织")
    @PostMapping(value = "/sys_user_org/get_by_user_no")
    public SysOrganization selectByUserNo(@RequestParam("userNo") String userNo){
        return UserOrgDao.selectByUserNo(userNo);
    }

    @ApiOperation(value = "查询所有角色")
    @PostMapping(value = "/sys_roles/get_all_role")
    public List<Sys_Roles> selectRoleList(){
        return sysRoleDao.selectRoleList(new Sys_Roles());
    }

    @ApiOperation(value = "根据组织查询角色")
    @PostMapping(value = "/sys_role_org/get_role_by_org")
    public Sys_Roles selectRoleByOrgNo(@RequestParam("orgNo") String orgNo){
        return roleOrgDao.selectRoleByOrgNo(orgNo);
    }

    @ApiOperation(value = "获取用户列表")
    @PostMapping(value = "/user/list")
    public List<Data_User_Info> getUsetList(){
        return userInfoDao.GetUserList();
    }

    @ApiOperation(value = "根据用户编号查询组织")
    @PostMapping(value = "/sys_user_org/list_by_user_no")
    public List<SysOrganization> getOrgByUserNo(@RequestParam("orgNo") String userNo){
        return organizationDao.getOrgByUserNo(userNo);
    }

    @ApiOperation(value = "根据组织编号查询用户")
    @PostMapping(value = "/user/list_by_org_no/{orgNo}")
    public List<UserInfo> listByOrgNo(@PathVariable("orgNo") String orgNo){
        return userInfoDao.selectUserByOrg(orgNo);
    }
}