Commit 0631aac6 authored by “yiyousong”'s avatar “yiyousong”
parents 0150927a 32769620
package com.mortals.xhx.base.framework.security;
package com.mortals.xhx.base.framework.interceptor;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.SysConstains;
......
......@@ -70,7 +70,7 @@ public class AuthUserInterceptor extends BaseInterceptor {
}else if(loginUser.isAdmin()||loginUser.getUserType()==1||loginUser.getUserType()== Constant.CUSTOMER_USER){
return super.preHandle(request, response, handler);
} else {
ret.put("code", -1);
ret.put("code", 405);
ret.put("msg", "用户无该操作权限!");
ServletUtils.renderString(response, JSONObject.toJSONString(ret));
return false;
......
......@@ -157,70 +157,4 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
return ret.toJSONString();
}
private void generateBlackCookie(HttpServletRequest request, HttpServletResponse response, String loginName, Set<String> urls) {
try {
String cacheKey = RedisKey.KEY_MENU_CACHE + loginName;
String securityKey = GlobalSysInfo.getPropertyValue(SysConstains.PROP_COOKIE_SECURITY_KEY);
//应为Cookie会超长,所以改为仅存储key将值放入redis
//CookieService.setCookieForAuth(request, response, securityKey, null);
StringBuilder sb = new StringBuilder();
if (urls != null && urls.size() > 0) {
for (String url : urls) {
int index = url.hashCode() & (Integer.MAX_VALUE - 1);
sb.append(index).append(",");
}
}
String menuUrl = sb.toString();
menuUrl = AESUtil.encrypt(menuUrl, securityKey);
cacheService.set(cacheKey, menuUrl, 604800);
HttpUtil.setCookieValue(request, response, SysConstains.COOKIE_MENU, cacheKey, -1);
} catch (Throwable e) {
}
}
@RequestMapping("validcode")
public String validCode(HttpServletRequest request, HttpServletResponse response, LoginForm loginForm) {
JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "登录名或密码为空");
}
UserEntity user = null;
try {
user = userService.doCheckUser(loginName, password);
if (user == null) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "用户名或密码不正确");
} else if (StringUtils.isEmpty(user.getMobile())) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "用户无正确的手机号");
} else {
String mobile = StringUtils.trim(user.getMobile());
String sessionId = request.getSession().getId();
String ip = super.getRequestIP(request);
boolean result = validCodeService.createSmsValidCode(sessionId, ip, mobile);
if (result) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
} else {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "验证码发送失败,请稍后在试!");
}
}
} catch (Exception e) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "验证码发送失败:" + super.convertException(e));
} finally {
if (user == null) {
user = new UserEntity();
user.setLoginName(loginName);
}
recordSysLog(request, user, "用户获取短信验证码");
}
return ret.toJSONString();
}
}
......@@ -9,7 +9,9 @@
package com.mortals.xhx.base.system.resource.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
......@@ -31,7 +33,7 @@ public interface ResourceService extends ICRUDService<ResourceEntity,Long> {
* @return
* @throws AppException
*/
public List<ResourceEntity> findAllEnable() throws AppException;
List<ResourceEntity> findAllEnable() throws AppException;
/**
* 根据用户查询可用资源
......@@ -39,7 +41,7 @@ public interface ResourceService extends ICRUDService<ResourceEntity,Long> {
* @return
* @throws AppException
*/
public List<ResourceEntity> findListByUserId(Long userId) throws AppException;
List<ResourceEntity> findListByUserId(Long userId) throws AppException;
/**
* 查询用户可用资源
......@@ -47,7 +49,7 @@ public interface ResourceService extends ICRUDService<ResourceEntity,Long> {
* @return 字符串,多个以逗号分隔
* @throws AppException
*/
public String findUrlByUserId(Long userId) throws AppException;
String findUrlByUserId(Long userId) throws AppException;
/**
* 查询用户用资源集合
......@@ -55,7 +57,7 @@ public interface ResourceService extends ICRUDService<ResourceEntity,Long> {
* @return
* @throws AppException
*/
public Set<String> findUrlSetByUserId(Long userId) throws AppException;
Set<String> findUrlSetByUserId(Long userId) throws AppException;
/**
* 获取所有资源,不分页
......@@ -63,4 +65,8 @@ public interface ResourceService extends ICRUDService<ResourceEntity,Long> {
* @param userType
*/
List<ResourceEntity> findAll(int userType);
Rest<String> refreshResourceUrl(String packageName, Context context);
}
\ No newline at end of file
/**
* 文件:ResourceServiceImpl.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
* 文件:ResourceServiceImpl.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.resource.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.resource.dao.ResourceDao;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.model.ResourceQuery;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.role.model.RoleAuthEntity;
import com.mortals.xhx.base.system.role.model.RoleAuthQuery;
import com.mortals.xhx.base.system.role.service.RoleAuthService;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.utils.ControllerScanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import static com.mortals.xhx.common.utils.MenuEncodeUtil.generateMenuUrlCode;
/**
* <p>Title: 资源信息</p>
* <p>Description: ResourceServiceImpl service接口 </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
* @author
*
* @author
* @version 1.0.0
*/
@Service("resourceService")
public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao,ResourceEntity,Long> implements ResourceService {
public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, ResourceEntity, Long> implements ResourceService {
@Autowired
private ICacheService cacheService;
@Autowired
private RoleAuthService roleAuthService;
@Override
public List<ResourceEntity> findAllEnable() throws AppException {
......@@ -52,7 +70,7 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao,Res
@Override
public Set<String> findUrlSetByUserId(Long userId) throws AppException {
Set<String> urls = new HashSet<String>();
Set<String> urls = new HashSet<>();
List<ResourceEntity> resList = this.findListByUserId(userId);
for (ResourceEntity res : resList) {
String url = res.getUrl();
......@@ -69,5 +87,107 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao,Res
public List<ResourceEntity> findAll(int userType) {
return dao.getAll(userType);
}
@Override
public Rest<String> refreshResourceUrl(String packageName, Context context) {
List<Class<?>> classList = ControllerScanUtil.getAllClassByPackageName(packageName);
//System.out.println(classList); //获取到了所有的类
List<ResourceEntity> newResourcelist = ControllerScanUtil.getAnnotationInfo(classList).stream().filter(f->!ObjectUtils.isEmpty(f.getUrl())).collect(Collectors.toList());
Map<String, List<ResourceEntity>> localResourceMap = this.find(new ResourceQuery()).stream().collect(Collectors.groupingBy(x -> x.getName()));
Map<String, List<ResourceEntity>> newResourceMap = newResourcelist.stream().collect(Collectors.groupingBy(x -> x.getName()));
//更新 与新增 新加的;
newResourceMap.entrySet().forEach(item -> {
List<ResourceEntity> resourceEntities = item.getValue();
if (ObjectUtils.isEmpty(resourceEntities)) return;
if (resourceEntities.size() == 1) {
ResourceEntity resourceEntity = resourceEntities.get(0);
saveUpdateResourceEntity(context, localResourceMap, resourceEntity);
} else if (resourceEntities.size() > 1) {
//原始扫描 有多个资源列表针对一个名称的
for (ResourceEntity resourceEntity : resourceEntities) {
saveUpdateResourceEntity(context, localResourceMap, resourceEntity);
}
}
});
return Rest.ok();
}
private void saveUpdateResourceEntity(Context context, Map<String, List<ResourceEntity>> localResourceMap, ResourceEntity resourceEntity) {
//查找 本地是否已经存在了
List<ResourceEntity> tempResourceList = localResourceMap.getOrDefault(resourceEntity.getName(), new ArrayList<>());
if (tempResourceList.size() == 0) {
//新增 resource;
resourceEntity.setCreateUserId(this.getContextUserId(context));
resourceEntity.setCreateTime(new Date());
this.save(resourceEntity, context);
} else if (tempResourceList.size() == 1) {
//更新
ResourceEntity tempResource = tempResourceList.get(0);
Set<String> setUrl = Arrays.stream(resourceEntity.getUrl().split(",")).collect(Collectors.toSet());
Arrays.stream(tempResource.getUrl().split(",")).forEach(i -> {
setUrl.add(i);
});
tempResource.setUrl(setUrl.stream().collect(Collectors.joining(",")));
this.update(tempResource, context);
} else if (tempResourceList.size() > 1) {
//找到多个同名的 资源配置
for (ResourceEntity tempResource : tempResourceList) {
//模糊匹配到路径有一个存在的
Set<String> setUrl = Arrays.stream(resourceEntity.getUrl().split(",")).collect(Collectors.toSet());
String[] splitUrl = tempResource.getUrl().split(",");
Boolean bool = false;
for (int i = 0; i < splitUrl.length; i++) {
if (setUrl.contains(splitUrl[i])) {
bool = true;
break;
}
}
if (bool) {
//匹配到了,更新当前这个资源
Arrays.stream(tempResource.getUrl().split(",")).forEach(i -> {
setUrl.add(i);
});
tempResource.setUrl(setUrl.stream().collect(Collectors.joining(",")));
this.update(tempResource, context);
}
}
}
}
@Override
protected void updateAfter(ResourceEntity entity, Context context) throws AppException {
updateUserMenuUrlCache();
}
@Override
protected void saveAfter(ResourceEntity entity, Context context) throws AppException {
updateUserMenuUrlCache();
}
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
//删除关联表中数据
if (!ObjectUtils.isEmpty(ids)) {
RoleAuthQuery query = new RoleAuthQuery();
query.setResourceIdList(Arrays.asList(ids));
List<RoleAuthEntity> roleAuthEntities = roleAuthService.find(query);
if (!ObjectUtils.isEmpty(roleAuthEntities)) {
roleAuthService.remove(roleAuthEntities.stream().map(m -> m.getId()).toArray(Long[]::new), context);
updateUserMenuUrlCache();
}
}
}
private void updateUserMenuUrlCache() {
//更新用户菜单
Set<String> hkeys = cacheService.hkeys(RedisKey.KEY_USER_MENU_CACHE);
for (String userId : hkeys) {
Set<String> urls = this.findUrlSetByUserId(DataUtil.converStr2Long(userId, 0L));
String menuUrlCode = generateMenuUrlCode(urls);
cacheService.hset(RedisKey.KEY_USER_MENU_CACHE, userId, menuUrlCode);
}
}
}
\ No newline at end of file
......@@ -2,9 +2,13 @@ package com.mortals.xhx.base.system.resource.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.Rest;
import com.mortals.framework.common.code.UserType;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.service.ResourceService;
......@@ -13,8 +17,10 @@ import com.mortals.xhx.common.code.SourceType;
import lombok.extern.slf4j.Slf4j;
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;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
......@@ -27,37 +33,63 @@ import java.util.Map;
@Slf4j
@RestController
@RequestMapping("resource")
public class ResourceController extends BaseCRUDJsonBodyMappingController<ResourceService,ResourceEntity,Long> {
public ResourceController(){
super.setModuleDesc("资源信息");
}
@Override
protected void init(Map<String, Object> model, Context context) {
Map<String, Object> statsus = new HashMap<String, Object>();
statsus.put("authType", AuthType.getEnumMap());
statsus.put("sourceType", SourceType.getEnumMap());
if (getCurUser().isAdmin()) {
statsus.put("userType", IBaseEnum.getEnumMap(UserType.class));
} else {
statsus.put("userType", UserType.findByValue(getCurUser().getUserType()));
}
model.put(KEY_RESULT_DICT, statsus);
}
/**
* 获取所有资源
*
* @return
*/
@PostMapping("allResources")
public String allResources(int userType) {
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "所有的customer以及user");
ret.put(KEY_RESULT_DATA, service.findAll(userType));
return ret.toJSONString();
}
public class ResourceController extends BaseCRUDJsonBodyMappingController<ResourceService, ResourceEntity, Long> {
public ResourceController() {
super.setModuleDesc("资源信息");
}
@Override
protected void init(Map<String, Object> model, Context context) {
Map<String, Object> statsus = new HashMap<String, Object>();
statsus.put("authType", AuthType.getEnumMap());
statsus.put("sourceType", SourceType.getEnumMap());
if (getCurUser().isAdmin()) {
statsus.put("userType", IBaseEnum.getEnumMap(UserType.class));
} else {
statsus.put("userType", UserType.findByValue(getCurUser().getUserType()));
}
model.put(KEY_RESULT_DICT, statsus);
}
/**
* 获取所有资源
*
* @return
*/
@PostMapping("allResources")
public String allResources(int userType) {
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "所有的customer以及user");
ret.put(KEY_RESULT_DATA, service.findAll(userType));
return ret.toJSONString();
}
@Override
protected void doListBefore(ResourceEntity query, Map<String, Object> model, Context context) throws AppException {
query.setOrderColList(Arrays.asList(new OrderCol("sourceType")));
super.doListBefore(query, model, context);
}
/**
* 资源路径刷新
*/
@PostMapping(value = "refreshUrl")
@UnAuth
public Rest<String> refreshUrl(@RequestParam(name = "packageName", defaultValue = "com.mortals.xhx") String packageName) {
log.info("刷新资源路径,packageName", packageName);
String busiDesc = this.getModuleDesc() + "资源路径刷新";
Rest<String> rest = Rest.ok(busiDesc + " 【成功】");
try {
this.service.refreshResourceUrl(packageName, getContext());
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
}
\ No newline at end of file
package com.mortals.xhx.base.system.user.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
import java.util.List;
/**
*
* Description:User
* date: 2021-9-26 16:11:48
*/
@Data
public class UserEntityExt extends BaseEntityLong {
/**
* 唯一标识
*/
@JSONField(serialize = false)
private String token;
/**
* 登录时间
*/
private Long loginTime;
/**
* 过期时间
*/
private Long expireTime;
private String siteName;
private List<Long> roleIds;
private String siteCode;
private String oldPassword;
private String newPassword;
private String siteIds;
/**
* 菜单栏
*/
private String menuUrl;
/**
* 所属区域code,多个逗号分隔
*/
private String areaCodes;
}
\ No newline at end of file
package com.mortals.xhx.base.system.user.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
/**
* 用户信息业务视图对象
*
* @author zxfei
* @date 2022-07-05
*/
@Data
public class UserVo extends BaseEntityLong {
/**
* 站点名称
*/
private String siteName;
private String roleIds;
/**
* 唯一标识
*/
private String token;
/**
* 菜单栏
*/
private String menuUrl;
/**
* 登录时间
*/
private Long loginTime;
/**
* 过期时间
*/
private Long expireTime;
private String oldPassword;
private String newPassword;
private String siteIds;
}
\ No newline at end of file
......@@ -8,6 +8,7 @@
package com.mortals.xhx.base.system.user.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDCacheService;
......@@ -30,16 +31,8 @@ import java.util.Set;
*/
public interface UserService extends ICRUDCacheService<UserEntity,Long> {
/**
* 用户登录
*
* @param loginName 登录用户名
* @param password 登录密码
* @param loginIp 登录IP
* @return
* @throws AppException
*/
public UserEntity doLogin(String loginName, String password, String loginIp) throws AppException;
/**
* 校验用户名与密码是否正确
......@@ -49,16 +42,7 @@ public interface UserService extends ICRUDCacheService<UserEntity,Long> {
* @return
* @throws AppException
*/
public UserEntity doCheckUser(String loginName, String password) throws AppException;
/**
* 检查用户是否存在
*
* @param loginName 登录用户名
* @param userId 密码
* @return
*/
public boolean existUser(String loginName, Long userId) throws AppException;
UserEntity doCheckUser(String loginName, String password) throws AppException;
/**
* 通过登录用户获取菜单功能权限
......@@ -66,7 +50,7 @@ public interface UserService extends ICRUDCacheService<UserEntity,Long> {
* @param user
* @return
*/
public List<MenuEntity> findOutlookBarList(IUser user);
List<MenuEntity> findOutlookBarList(IUser user);
/**
* 查询用户所有有权限的菜单ID
......@@ -74,47 +58,9 @@ public interface UserService extends ICRUDCacheService<UserEntity,Long> {
* @param userEntity
* @return
*/
public Set<Long> findAllAuthIds(UserEntity userEntity) throws AppException;
/**
* 查询用户记录
*
* @param platformId
* @param params
* @param currPage
* @param prePageResult
* @return
* @throws AppException
*/
public Result<UserEntity> find(Long platformId, UserEntity params, int currPage, int prePageResult) throws AppException;
/**
* 为客户创建用户
*
* @param currUser 当前用户
* @param customerId 客户ID
* @param customerName 客户名称
* @param loginName
* @param password
* @param userName
* @param mobile
* @return
* @throws AppException
*/
public UserEntity createUser(IUser currUser, Long customerId, String customerName, String loginName, String password,
String userName, String mobile) throws AppException;
/**
* 用户修改密码
*
* @param loginName
* @param oldPwd
* @param newPwd
* @return
* @throws AppException
*/
public boolean updateUserPwd(String loginName, String oldPwd, String newPwd) throws AppException;
Set<Long> findAllAuthIds(UserEntity userEntity) throws AppException;
Rest<Void> refreshUser();
UserDao getUserDao();
......
......@@ -8,33 +8,25 @@
package com.mortals.xhx.base.system.user.web;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.service.IUser;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.Rest;
import com.mortals.framework.common.code.UserType;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.role.model.RoleEntity;
import com.mortals.xhx.base.system.role.service.RoleService;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.UserStatus;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.code.UserType;
import com.mortals.xhx.common.key.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.base.framework.annotation.Operlog;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* <p>Title: 用户信息</p>
......@@ -48,13 +40,10 @@ import com.mortals.xhx.base.system.user.service.UserService;
@RequestMapping("user")
public class UserController extends BaseCRUDJsonBodyMappingController<UserService, UserEntity, Long> {
@Autowired
private UserService userService;
@Autowired
private RoleService roleService;
public UserController() {
super.setFormClass(UserForm.class);
super.setModuleDesc("用户信息");
}
......@@ -68,31 +57,13 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
super.init(model, context);
}
@Override
protected int editAfter(Long id, Map<String, Object> model, UserEntity entity, Context context) throws AppException {
entity.setLoginPwd(null);
entity.setLoginPwd1(null);
entity.setLoginPwd2(null);
entity.setLoginPwd3(null);
return 1;
}
@RequestMapping(value = "change/password", method = RequestMethod.POST)
public String changePassword(@RequestBody UserEntity entity) {
IUser user = this.getCurUser();
if(user == null){
return this.createFailJsonResp("请先登录");
}
JSONObject ret = new JSONObject();
try {
service.updateUserPwd(super.getCurUser().getLoginName(), entity.getOldPassword(), entity.getNewPassword());
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "密码修改成功!");
} catch (Exception e) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
}
return ret.toJSONString();
@PostMapping({"refreshUser"})
@UnAuth
public Rest<Object> refreshUser() {
log.info("刷新用户");
this.service.refreshUser();
return Rest.ok("用户同步刷新操作成功");
}
}
\ No newline at end of file
/**
* 文件:UserForm.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.user.web;
import com.mortals.framework.web.BaseCRUDFormLong;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
/**
* <p>Title: 用户信息</p>
* <p>Description: UserForm </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
* @author
* @version 1.0.0
*/
public class UserForm extends BaseCRUDFormLong<UserEntity> {
private UserEntity entity = new UserEntity();
private UserQuery query = new UserQuery();
public UserForm(){
}
@Override
public UserEntity getEntity() {
return entity;
}
public void setEntity(UserEntity entity) {
this.entity = entity;
}
@Override
public UserQuery getQuery() {
return query;
}
public void setQuery(UserQuery query) {
this.query = query;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment