登录修改
This commit is contained in:
@ -0,0 +1,54 @@
|
||||
package com.ruoyi.web.controller.bgt;
|
||||
|
||||
import com.ruoyi.bgt.domain.dto.UserRealNameAuthenticationDTO;
|
||||
import com.ruoyi.bgt.service.IBgtUserService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 后台管理包工头Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-14
|
||||
*/
|
||||
@Api(value = "APP包工头控制器", tags = {"APP包工头管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/app/bgt/user")
|
||||
public class AppBgtUserController extends BaseController {
|
||||
|
||||
private final IBgtUserService iBgtUserService;
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
@ApiOperation("实名认证")
|
||||
@Log(title = "APP管理包工头", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping
|
||||
public AjaxResult<Void> realNameAuthentication(@Validated @RequestBody UserRealNameAuthenticationDTO dto) {
|
||||
return toAjax(iBgtUserService.realNameAuthentication(dto));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
@ApiOperation("个人信息")
|
||||
@RepeatSubmit
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult<Void> getInfo(@Validated @RequestBody UserRealNameAuthenticationDTO dto) {
|
||||
return toAjax(iBgtUserService.realNameAuthentication(dto));
|
||||
}
|
||||
|
||||
}
|
@ -25,12 +25,12 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP包工头Controller
|
||||
* 后台管理包工头Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-14
|
||||
*/
|
||||
@Api(value = "APP包工头控制器", tags = {"APP包工头管理"})
|
||||
@Api(value = "后台管理包工头控制器", tags = {"后台管理包工头管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/bgt/user")
|
||||
@ -39,9 +39,9 @@ public class BgtUserController extends BaseController {
|
||||
private final IBgtUserService iBgtUserService;
|
||||
|
||||
/**
|
||||
* 查询APP包工头列表
|
||||
* 查询后台管理包工头列表
|
||||
*/
|
||||
@ApiOperation("查询APP包工头列表")
|
||||
@ApiOperation("查询后台管理包工头列表")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:user:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BgtUser> list(@Validated BgtUserQueryBo bo) {
|
||||
@ -49,22 +49,22 @@ public class BgtUserController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出APP包工头列表
|
||||
* 导出后台管理包工头列表
|
||||
*/
|
||||
@ApiOperation("导出APP包工头列表")
|
||||
@ApiOperation("导出后台管理包工头列表")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:user:export')")
|
||||
@Log(title = "APP包工头", businessType = BusinessType.EXPORT)
|
||||
@Log(title = "后台管理包工头", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult<BgtUser> export(@Validated BgtUserQueryBo bo) {
|
||||
List<BgtUser> list = iBgtUserService.queryList(bo);
|
||||
ExcelUtil<BgtUser> util = new ExcelUtil<BgtUser>(BgtUser.class);
|
||||
return util.exportExcel(list, "APP包工头");
|
||||
return util.exportExcel(list, "后台管理包工头");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取APP包工头详细信息
|
||||
* 获取后台管理包工头详细信息
|
||||
*/
|
||||
@ApiOperation("获取APP包工头详细信息")
|
||||
@ApiOperation("获取后台管理包工头详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:user:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult<BgtUser> getInfo(@NotNull(message = "主键不能为空")
|
||||
@ -73,11 +73,11 @@ public class BgtUserController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增APP包工头
|
||||
* 新增后台管理包工头
|
||||
*/
|
||||
@ApiOperation("新增APP包工头")
|
||||
@ApiOperation("新增后台管理包工头")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:user:add')")
|
||||
@Log(title = "APP包工头", businessType = BusinessType.INSERT)
|
||||
@Log(title = "后台管理包工头", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public AjaxResult<Void> add(@Validated @RequestBody BgtUser bo) {
|
||||
@ -85,11 +85,11 @@ public class BgtUserController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改APP包工头
|
||||
* 修改后台管理包工头
|
||||
*/
|
||||
@ApiOperation("修改APP包工头")
|
||||
@ApiOperation("修改后台管理包工头")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:user:edit')")
|
||||
@Log(title = "APP包工头", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "后台管理包工头", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public AjaxResult<Void> edit(@Validated @RequestBody BgtUser bo) {
|
||||
@ -97,25 +97,14 @@ public class BgtUserController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除APP包工头
|
||||
* 删除后台管理包工头
|
||||
*/
|
||||
@ApiOperation("删除APP包工头")
|
||||
@ApiOperation("删除后台管理包工头")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:user:remove')")
|
||||
@Log(title = "APP包工头" , businessType = BusinessType.DELETE)
|
||||
@Log(title = "后台管理包工头" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable String[] ids) {
|
||||
return toAjax(iBgtUserService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
@ApiOperation("实名认证")
|
||||
@Log(title = "APP包工头", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping("/realNameAuthentication")
|
||||
public AjaxResult<Void> realNameAuthentication(@Validated @RequestBody UserRealNameAuthenticationDTO dto) {
|
||||
return toAjax(iBgtUserService.realNameAuthentication(dto));
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,13 @@
|
||||
package com.ruoyi.web.controller.common;
|
||||
|
||||
import com.ruoyi.bgt.service.IBgtUserService;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.BgtUser;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.BgtLoginBody;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.framework.web.service.AppLoginService;
|
||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
@ -36,6 +41,9 @@ public class AppLoginController
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private IBgtUserService iBgtUserService;
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
*
|
||||
@ -53,6 +61,39 @@ public class AppLoginController
|
||||
return AjaxResult.success(ajax);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("/app/getInfo")
|
||||
public AjaxResult getInfo()
|
||||
{
|
||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||
SysUser user = loginUser.getUser();
|
||||
String userType = loginUser.getUserType();
|
||||
Map<String,Object> ajax = new HashMap<>();
|
||||
switch (userType){
|
||||
case Constants.BGT:
|
||||
BgtUser bgtUser = iBgtUserService.selectUserByPhone(user.getPhonenumber());
|
||||
ajax.put("user", bgtUser);
|
||||
break;
|
||||
case Constants.WGZ:
|
||||
ajax.put("user", user);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// 角色集合
|
||||
// Set<String> roles = permissionService.getRolePermission(user);
|
||||
// 权限集合
|
||||
// Set<String> permissions = permissionService.getMenuPermission(user);
|
||||
// ajax.put("roles", roles);
|
||||
// ajax.put("permissions", permissions);
|
||||
return AjaxResult.success(ajax);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/test")
|
||||
public AjaxResult test(){
|
||||
return AjaxResult.success("test");
|
||||
|
Reference in New Issue
Block a user