forked from github/dataease
fix: 修复系统管理api
This commit is contained in:
parent
db346bed6c
commit
a4683eca0d
@ -53,7 +53,7 @@ public class ShiroServiceImpl implements ShiroService {
|
||||
filterChainDefinitionMap.put("/linkJump/queryPanelJumpInfo/**", ANON);
|
||||
|
||||
//未读消息数量
|
||||
filterChainDefinitionMap.put("/api/sys_msg/unReadCount", ANON);
|
||||
// filterChainDefinitionMap.put("/api/sys_msg/unReadCount/**", ANON);
|
||||
|
||||
filterChainDefinitionMap.put("/**/*.json", ANON);
|
||||
filterChainDefinitionMap.put("/system/ui/**", ANON);
|
||||
|
@ -2,10 +2,12 @@ package io.dataease.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("消息渠道")
|
||||
public class SysMsgChannel implements Serializable {
|
||||
|
||||
@ApiModelProperty("消息渠道ID")
|
||||
|
@ -2,10 +2,12 @@ package io.dataease.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("订阅信息")
|
||||
public class SysMsgSetting implements Serializable {
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Long msgSettingId;
|
||||
|
@ -2,10 +2,12 @@ package io.dataease.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("消息类型")
|
||||
public class SysMsgType implements Serializable {
|
||||
|
||||
@ApiModelProperty("消息类型ID")
|
||||
@ -17,10 +19,10 @@ public class SysMsgType implements Serializable {
|
||||
@ApiModelProperty("消息类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@ApiModelProperty("回调路由")
|
||||
private String router;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@ApiModelProperty("回调函数")
|
||||
private String callback;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -1,44 +1,64 @@
|
||||
package io.dataease.base.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SysUser implements Serializable {
|
||||
@ApiModelProperty("ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
private Long deptId;
|
||||
|
||||
@ApiModelProperty("账号")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String nickName;
|
||||
|
||||
@ApiModelProperty("性别")
|
||||
private String gender;
|
||||
|
||||
@ApiModelProperty("电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty("是否管理员")
|
||||
private Boolean isAdmin;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private Long enabled;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty("修改人")
|
||||
private String updateBy;
|
||||
|
||||
@ApiModelProperty("密码重置时间")
|
||||
private Long pwdResetTime;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Long createTime;
|
||||
|
||||
@ApiModelProperty("修改时间")
|
||||
private Long updateTime;
|
||||
|
||||
@ApiModelProperty("语言")
|
||||
private String language;
|
||||
|
||||
@ApiModelProperty("用户来源")
|
||||
private Integer from;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
private String sub;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -43,8 +43,8 @@ public class IndexController {
|
||||
return "doc.html";
|
||||
default:
|
||||
// DataEaseException.throwException("Invalid License.");
|
||||
return "nolic.html";
|
||||
// return "doc.html";
|
||||
/* return "nolic.html"; */
|
||||
return "doc.html";
|
||||
}
|
||||
// return "index.html";
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package io.dataease.controller.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
||||
@ApiModel("已同步用户")
|
||||
public class ExistLdapUser {
|
||||
|
||||
@ApiModelProperty("账号")
|
||||
private String username;
|
||||
|
||||
}
|
@ -23,6 +23,8 @@ import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
|
||||
@Api(tags = "系统:消息管理")
|
||||
@ApiSupport(order = 230)
|
||||
@ -35,6 +37,11 @@ public class MsgController {
|
||||
|
||||
@ApiOperation("分页查询")
|
||||
@PostMapping("/list/{goPage}/{pageSize}")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(paramType="path", name = "goPage", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(paramType="path", name = "pageSize", value = "页容量", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "msgRequest", value = "查询条件", required = true)
|
||||
})
|
||||
public Pager<List<MsgGridDto>> messages(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody MsgRequest msgRequest) {
|
||||
Long userId = AuthUtils.getUser().getUserId();
|
||||
List<Long> typeIds = null;
|
||||
@ -50,16 +57,18 @@ public class MsgController {
|
||||
|
||||
@ApiOperation("查询未读数量")
|
||||
@PostMapping("/unReadCount")
|
||||
public Long unReadCount(@RequestBody Map<String, Long> request) {
|
||||
if(null == request || null == request.get("userId")) {
|
||||
public Long unReadCount() {;
|
||||
Long userId = null;
|
||||
if(null == AuthUtils.getUser() || (userId = AuthUtils.getUser().getUserId()) == null) {
|
||||
throw new RuntimeException("缺少用户ID");
|
||||
}
|
||||
Long userId = request.get("userId");
|
||||
// Long userId = request.get("userId");
|
||||
return sysMsgService.queryCount(userId);
|
||||
}
|
||||
|
||||
@ApiOperation("设置已读")
|
||||
@PostMapping("/setReaded/{msgId}")
|
||||
@ApiImplicitParam(paramType="path", name = "msgId", value = "消息ID", required = true, dataType = "Long")
|
||||
public void setReaded(@PathVariable Long msgId) {
|
||||
sysMsgService.setReaded(msgId);
|
||||
}
|
||||
@ -67,6 +76,7 @@ public class MsgController {
|
||||
|
||||
@ApiOperation("批量设置已读")
|
||||
@PostMapping("/batchRead")
|
||||
@ApiImplicitParam(name = "msgIds", value = "消息ID集合", required = true, dataType = "List")
|
||||
public void batchRead(@RequestBody List<Long> msgIds) {
|
||||
sysMsgService.setBatchReaded(msgIds);
|
||||
}
|
||||
@ -79,6 +89,7 @@ public class MsgController {
|
||||
|
||||
@ApiOperation("批量删除")
|
||||
@PostMapping("/batchDelete")
|
||||
@ApiImplicitParam(name = "msgIds", value = "消息ID集合", required = true, dataType = "List")
|
||||
public void batchDelete(@RequestBody List<Long> msgIds) {
|
||||
sysMsgService.batchDelete(msgIds);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import io.dataease.base.domain.SysRole;
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.commons.utils.PageUtils;
|
||||
import io.dataease.commons.utils.Pager;
|
||||
import io.dataease.controller.response.ExistLdapUser;
|
||||
import io.dataease.controller.sys.base.BaseGridRequest;
|
||||
import io.dataease.controller.sys.request.SysUserCreateRequest;
|
||||
import io.dataease.controller.sys.request.SysUserPwdRequest;
|
||||
@ -18,13 +19,17 @@ import io.dataease.controller.sys.response.SysUserGridResponse;
|
||||
import io.dataease.service.sys.SysRoleService;
|
||||
import io.dataease.service.sys.SysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "系统:用户管理")
|
||||
@ -40,6 +45,11 @@ public class SysUserController {
|
||||
|
||||
@ApiOperation("查询用户")
|
||||
@PostMapping("/userGrid/{goPage}/{pageSize}")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(paramType="path", name = "goPage", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(paramType="path", name = "pageSize", value = "页容量", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "request", value = "查询条件", required = true)
|
||||
})
|
||||
public Pager<List<SysUserGridResponse>> userGrid(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody BaseGridRequest request) {
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
return PageUtils.setPageInfo(page, sysUserService.query(request));
|
||||
@ -63,6 +73,7 @@ public class SysUserController {
|
||||
|
||||
@ApiOperation("删除用户")
|
||||
@PostMapping("/delete/{userId}")
|
||||
@ApiImplicitParam(paramType = "path", value = "用户ID", name = "userId", required = true, dataType = "Integer")
|
||||
public void delete(@PathVariable("userId") Long userId){
|
||||
sysUserService.delete(userId);
|
||||
}
|
||||
@ -103,6 +114,7 @@ public class SysUserController {
|
||||
|
||||
@ApiOperation("设置语言")
|
||||
@PostMapping("/setLanguage/{language}")
|
||||
@ApiImplicitParam(paramType="path", name = "language", value = "语言(zh_CN, zh_TW, en_US)", required = true, dataType = "String")
|
||||
public void setLanguage(@PathVariable String language) {
|
||||
CurrentUserDto user = AuthUtils.getUser();
|
||||
Optional.ofNullable(language).ifPresent(currentLanguage -> {
|
||||
@ -122,6 +134,11 @@ public class SysUserController {
|
||||
|
||||
@ApiOperation("查询角色")
|
||||
@PostMapping("/roleGrid/{goPage}/{pageSize}")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(paramType="path", name = "goPage", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(paramType="path", name = "pageSize", value = "页容量", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "request", value = "查询条件", required = true)
|
||||
})
|
||||
public Pager<List<SysRole>> roleGrid(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody BaseGridRequest request) {
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
Pager<List<SysRole>> listPager = PageUtils.setPageInfo(page, sysRoleService.query(request));
|
||||
@ -137,8 +154,13 @@ public class SysUserController {
|
||||
|
||||
@ApiOperation("已同步用户")
|
||||
@PostMapping("/existLdapUsers")
|
||||
public List<String> getExistLdapUsers() {
|
||||
return sysUserService.ldapUserNames();
|
||||
public List<ExistLdapUser> getExistLdapUsers() {
|
||||
List<String> userNames = sysUserService.ldapUserNames();
|
||||
return userNames.stream().map(name -> {
|
||||
ExistLdapUser ldapUser = new ExistLdapUser();
|
||||
ldapUser.setUsername(name);
|
||||
return ldapUser;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package io.dataease.controller.sys.base;
|
||||
|
||||
import io.dataease.base.mapper.ext.query.GridExample;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
@ -8,9 +9,11 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@ApiModel("查询条件")
|
||||
public class BaseGridRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty("查询条件")
|
||||
@ApiModelProperty("条件集合")
|
||||
private List<ConditionEntity> conditions;
|
||||
|
||||
public List<ConditionEntity> getConditions() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.controller.sys.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ -7,6 +8,7 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("消息条件")
|
||||
public class MsgRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1920091635946508658L;
|
||||
|
@ -1,12 +1,14 @@
|
||||
package io.dataease.controller.sys.request;
|
||||
|
||||
import io.dataease.base.domain.SysUser;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("用户信息")
|
||||
public class SysUserCreateRequest extends SysUser {
|
||||
|
||||
@ApiModelProperty(value = "角色ID集合", required = true, position = 7)
|
||||
|
@ -1,12 +1,14 @@
|
||||
package io.dataease.controller.sys.request;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel("更新密码参数")
|
||||
public class SysUserPwdRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "用户ID", required = true)
|
||||
|
@ -1,16 +1,18 @@
|
||||
package io.dataease.controller.sys.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel("更新状态参数")
|
||||
public class SysUserStateRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "用户ID", required = true)
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, allowableValues = "1,0")
|
||||
@ApiModelProperty(value = "状态{1:可用, 0:禁用}", required = true, allowableValues = "1,0")
|
||||
private Long enabled;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package io.dataease.controller.sys.response;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ -8,6 +9,7 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("消息类型节点")
|
||||
public class SettingTreeNode implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2416283978185545199L;
|
||||
|
@ -9,12 +9,12 @@ export function query(pageIndex, pageSize, data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function unReadCount(data) {
|
||||
export function unReadCount() {
|
||||
return request({
|
||||
url: '/api/sys_msg/unReadCount',
|
||||
method: 'post',
|
||||
loading: false,
|
||||
data
|
||||
loading: false
|
||||
// data
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -187,10 +187,10 @@ export default {
|
||||
}.bind(this)
|
||||
})
|
||||
}
|
||||
const param = {
|
||||
/* const param = {
|
||||
userId: this.user.userId
|
||||
}
|
||||
unReadCount(param).then(res => {
|
||||
} */
|
||||
unReadCount().then(res => {
|
||||
this.count = res.data
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user