parent
c794d11019
commit
a3cb6feba6
@ -0,0 +1,74 @@
|
||||
package ${basePackage}.module.system.ent;
|
||||
|
||||
import ${basePackage}.frame.excel.annotation.ColumnDescription;
|
||||
import ${basePackage}.frame.excel.annotation.ColumnName;
|
||||
import ${basePackage}.frame.excel.annotation.SheetName;
|
||||
import ${basePackage}.frame.base.BaseEntity;
|
||||
|
||||
/**
|
||||
* RESOURCE - 资源
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
@SheetName("资源")
|
||||
public class Resource extends BaseEntity {
|
||||
|
||||
/**
|
||||
* VALUE - 资源内容
|
||||
*/
|
||||
@ColumnName("资源内容")
|
||||
@ColumnDescription("")
|
||||
private String value;
|
||||
/**
|
||||
* COMMENT - 资源描述
|
||||
*/
|
||||
@ColumnName("资源描述")
|
||||
@ColumnDescription("")
|
||||
private String comment;
|
||||
/**
|
||||
* RESOURCE_TYPE - 资源类型
|
||||
*/
|
||||
@ColumnName("资源类型")
|
||||
@ColumnDescription("")
|
||||
private String resourceType;
|
||||
/**
|
||||
* VALID - 是否有效
|
||||
*/
|
||||
@ColumnName("是否有效")
|
||||
@ColumnDescription("")
|
||||
private Boolean valid;
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return this.comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getResourceType() {
|
||||
return this.resourceType;
|
||||
}
|
||||
|
||||
public void setResourceType(String resourceType) {
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,173 @@
|
||||
package ${basePackage}.module.system.ent;
|
||||
|
||||
import java.util.Date;
|
||||
import ${basePackage}.frame.excel.annotation.ColumnDescription;
|
||||
import ${basePackage}.frame.excel.annotation.ColumnName;
|
||||
import ${basePackage}.frame.excel.annotation.SheetName;
|
||||
import ${basePackage}.frame.base.BaseEntity;
|
||||
|
||||
/**
|
||||
* TOKENS - 通行证
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
@SheetName("通行证")
|
||||
public class Tokens extends BaseEntity {
|
||||
|
||||
/**
|
||||
* USER_ID - 用户主键
|
||||
*/
|
||||
@ColumnName("用户主键")
|
||||
@ColumnDescription("")
|
||||
private Long userId;
|
||||
/**
|
||||
* USER_NAME - 用户名称
|
||||
*/
|
||||
@ColumnName("用户名称")
|
||||
@ColumnDescription("")
|
||||
private String userName;
|
||||
/**
|
||||
* LOGIN_TIME - 登录时间
|
||||
*/
|
||||
@ColumnName("登录时间")
|
||||
@ColumnDescription("")
|
||||
private Date loginTime;
|
||||
/**
|
||||
* VALID_TIME - 有效时间
|
||||
*/
|
||||
@ColumnName("有效时间")
|
||||
@ColumnDescription("")
|
||||
private Date validTime;
|
||||
/**
|
||||
* VALID - 是否有效
|
||||
*/
|
||||
@ColumnName("是否有效")
|
||||
@ColumnDescription("")
|
||||
private Boolean valid;
|
||||
/**
|
||||
* DEPT_ID - 部门主键
|
||||
*/
|
||||
@ColumnName("部门主键")
|
||||
@ColumnDescription("")
|
||||
private Long deptId;
|
||||
/**
|
||||
* DEPT_CODE - 部门代码
|
||||
*/
|
||||
@ColumnName("部门代码")
|
||||
@ColumnDescription("")
|
||||
private String deptCode;
|
||||
/**
|
||||
* DEPT_NAME - 部门名称
|
||||
*/
|
||||
@ColumnName("部门名称")
|
||||
@ColumnDescription("")
|
||||
private String deptName;
|
||||
/**
|
||||
* TERMINAL_TYPE - 终端类型
|
||||
*/
|
||||
@ColumnName("终端类型")
|
||||
@ColumnDescription("")
|
||||
private String terminalType;
|
||||
/**
|
||||
* TERMINAL_IP - 终端地址
|
||||
*/
|
||||
@ColumnName("终端地址")
|
||||
@ColumnDescription("")
|
||||
private String terminalIp;
|
||||
/**
|
||||
* TERMINAL_INFO - 终端信息
|
||||
*/
|
||||
@ColumnName("终端信息")
|
||||
@ColumnDescription("")
|
||||
private String terminalInfo;
|
||||
|
||||
public Long getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return this.userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public Date getLoginTime() {
|
||||
return this.loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(Date loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public Date getValidTime() {
|
||||
return this.validTime;
|
||||
}
|
||||
|
||||
public void setValidTime(Date validTime) {
|
||||
this.validTime = validTime;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return this.deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getTerminalType() {
|
||||
return this.terminalType;
|
||||
}
|
||||
|
||||
public void setTerminalType(String terminalType) {
|
||||
this.terminalType = terminalType;
|
||||
}
|
||||
|
||||
public String getTerminalIp() {
|
||||
return this.terminalIp;
|
||||
}
|
||||
|
||||
public void setTerminalIp(String terminalIp) {
|
||||
this.terminalIp = terminalIp;
|
||||
}
|
||||
|
||||
public String getTerminalInfo() {
|
||||
return this.terminalInfo;
|
||||
}
|
||||
|
||||
public void setTerminalInfo(String terminalInfo) {
|
||||
this.terminalInfo = terminalInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
|
||||
/**
|
||||
* 资源
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public interface ResourceManager {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResourceCreateResponse create(ResourceCreateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResourceDeleteResponse delete(ResourceDeleteRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResourceUpdateResponse update(ResourceUpdateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResourceFindResponse find(ResourceFindRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResourceGetResponse get(ResourceGetRequest request, Token token);
|
||||
}
|
@ -0,0 +1,167 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.frame.utils.IDgenerator;
|
||||
import ${basePackage}.frame.utils.Message;
|
||||
import ${basePackage}.frame.base.ErrorType;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.frame.utils.MapperUtil;
|
||||
import ${basePackage}.frame.utils.ValidationUtil;
|
||||
import ${basePackage}.module.system.ent.Resource;
|
||||
import ${basePackage}.module.system.mpr.ResourceMapper;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* RESOURCE - 资源
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
@Transactional
|
||||
@Service
|
||||
public class ResourceManagerImpl implements ResourceManager {
|
||||
|
||||
@Autowired
|
||||
private ResourceMapper resourceMapper;
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public ResourceCreateResponse create(ResourceCreateRequest request, Token token) {
|
||||
ResourceCreateResponse response = new ResourceCreateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long id = IDgenerator.nextId();
|
||||
Resource entity = MapperUtil.map(request, Resource.class);
|
||||
entity.setId(id);
|
||||
|
||||
long result = resourceMapper.insert(entity, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.CREATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setId(id);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public ResourceDeleteResponse delete(ResourceDeleteRequest request, Token token) {
|
||||
ResourceDeleteResponse response = new ResourceDeleteResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = resourceMapper.delete(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.DELETE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public ResourceUpdateResponse update(ResourceUpdateRequest request, Token token) {
|
||||
ResourceUpdateResponse response = new ResourceUpdateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = resourceMapper.update(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.UPDATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public ResourceFindResponse find(ResourceFindRequest request, Token token) {
|
||||
ResourceFindResponse response = new ResourceFindResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
||||
if (StringUtil.isNotEmpty(request.getSortKey())) {
|
||||
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
|
||||
}
|
||||
PageInfo<Resource> pageInfo = new PageInfo<>(resourceMapper.find(request, token));
|
||||
|
||||
response.setResult(pageInfo.getList());
|
||||
response.setTotalCount(pageInfo.getTotal());
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public ResourceGetResponse get(ResourceGetRequest request, Token token) {
|
||||
ResourceGetResponse response = new ResourceGetResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
Resource po = resourceMapper.get(request, token);
|
||||
|
||||
if (po != null) {
|
||||
response.setResource(po);
|
||||
} else {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.GET_FAILURE);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
|
||||
/**
|
||||
* 通行证
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public interface TokensManager {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
TokensCreateResponse create(TokensCreateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
TokensDeleteResponse delete(TokensDeleteRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
TokensUpdateResponse update(TokensUpdateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
TokensFindResponse find(TokensFindRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
TokensGetResponse get(TokensGetRequest request, Token token);
|
||||
}
|
@ -0,0 +1,167 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.frame.utils.IDgenerator;
|
||||
import ${basePackage}.frame.utils.Message;
|
||||
import ${basePackage}.frame.base.ErrorType;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.frame.utils.MapperUtil;
|
||||
import ${basePackage}.frame.utils.ValidationUtil;
|
||||
import ${basePackage}.module.system.ent.Tokens;
|
||||
import ${basePackage}.module.system.mpr.TokensMapper;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* TOKENS - 通行证
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
@Transactional
|
||||
@Service
|
||||
public class TokensManagerImpl implements TokensManager {
|
||||
|
||||
@Autowired
|
||||
private TokensMapper tokensMapper;
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public TokensCreateResponse create(TokensCreateRequest request, Token token) {
|
||||
TokensCreateResponse response = new TokensCreateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long id = IDgenerator.nextId();
|
||||
Tokens entity = MapperUtil.map(request, Tokens.class);
|
||||
entity.setId(id);
|
||||
|
||||
long result = tokensMapper.insert(entity, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.CREATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setId(id);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public TokensDeleteResponse delete(TokensDeleteRequest request, Token token) {
|
||||
TokensDeleteResponse response = new TokensDeleteResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = tokensMapper.delete(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.DELETE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public TokensUpdateResponse update(TokensUpdateRequest request, Token token) {
|
||||
TokensUpdateResponse response = new TokensUpdateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = tokensMapper.update(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.UPDATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public TokensFindResponse find(TokensFindRequest request, Token token) {
|
||||
TokensFindResponse response = new TokensFindResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
||||
if (StringUtil.isNotEmpty(request.getSortKey())) {
|
||||
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
|
||||
}
|
||||
PageInfo<Tokens> pageInfo = new PageInfo<>(tokensMapper.find(request, token));
|
||||
|
||||
response.setResult(pageInfo.getList());
|
||||
response.setTotalCount(pageInfo.getTotal());
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public TokensGetResponse get(TokensGetRequest request, Token token) {
|
||||
TokensGetResponse response = new TokensGetResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
Tokens po = tokensMapper.get(request, token);
|
||||
|
||||
if (po != null) {
|
||||
response.setTokens(po);
|
||||
} else {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.GET_FAILURE);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package ${basePackage}.module.system.mpr;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ${basePackage}.module.system.ent.Resource;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
|
||||
/**
|
||||
* RESOURCE - 资源
|
||||
*
|
||||
* @author author
|
||||
* @date 2019-12-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface ResourceMapper {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insert(@Param("request") Resource request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insertBatch(@Param("list") List<Resource> request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long delete(@Param("request") ResourceDeleteRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long update(@Param("request") ResourceUpdateRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
List<Resource> find(@Param("request") ResourceFindRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
Resource get(@Param("request") ResourceGetRequest request, @Param("token") Token token);
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${basePackage}.module.system.mpr.ResourceMapper">
|
||||
|
||||
<sql id="table">`SYS_RESOURCE`</sql>
|
||||
|
||||
<sql id="entityColumnList">
|
||||
`ID`,`VALUE`,`COMMENT`,`RESOURCE_TYPE`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME`
|
||||
</sql>
|
||||
|
||||
<resultMap id="resource" type="${basePackage}.module.system.ent.Resource">
|
||||
<result column="ID" jdbcType="BIGINT" property="id"/>
|
||||
<result column="VALUE" jdbcType="VARCHAR" property="value"/>
|
||||
<result column="COMMENT" jdbcType="VARCHAR" property="comment"/>
|
||||
<result column="RESOURCE_TYPE" jdbcType="VARCHAR" property="resourceType"/>
|
||||
<result column="VALID" jdbcType="BIT" property="valid"/>
|
||||
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
|
||||
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
|
||||
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
|
||||
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="LAST_UPDATE_BY" jdbcType="BIGINT" property="lastUpdateBy"/>
|
||||
<result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="find" resultMap="resource">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.value != null and request.value != ''">
|
||||
AND `VALUE` = ${r"#"}{request.value}
|
||||
</if>
|
||||
<if test="request.comment != null and request.comment != ''">
|
||||
AND `COMMENT` = ${r"#"}{request.comment}
|
||||
</if>
|
||||
<if test="request.resourceType != null and request.resourceType != ''">
|
||||
AND `RESOURCE_TYPE` = ${r"#"}{request.resourceType}
|
||||
</if>
|
||||
<if test="request.valid != null">
|
||||
AND `VALID` = ${r"#"}{request.valid}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="search" resultMap="resource">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
1 = 2
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
${r"#"}{request.id},
|
||||
${r"#"}{request.value,jdbcType=VARCHAR},
|
||||
${r"#"}{request.comment,jdbcType=VARCHAR},
|
||||
${r"#"}{request.resourceType,jdbcType=VARCHAR},
|
||||
${r"#"}{request.valid,jdbcType=BIT},
|
||||
0,
|
||||
0,
|
||||
${r"#"}{token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item= "item" index ="index" separator=",">
|
||||
(
|
||||
${r"#"}{item.id},
|
||||
${r"#"}{item.value,jdbcType=VARCHAR},
|
||||
${r"#"}{item.comment,jdbcType=VARCHAR},
|
||||
${r"#"}{item.resourceType,jdbcType=VARCHAR},
|
||||
${r"#"}{item.valid,jdbcType=BIT},
|
||||
0,
|
||||
0,
|
||||
${r"#"}{token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</foreach >
|
||||
</insert>
|
||||
|
||||
<update id="delete">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET `IS_DELETED` = 1
|
||||
WHERE `IS_DELETED` = 0
|
||||
AND `ID` = ${r"#"}{request.id}
|
||||
</update>
|
||||
|
||||
<update id="update">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET
|
||||
`VALUE` = ${r"#"}{request.value,jdbcType=VARCHAR},
|
||||
`COMMENT` = ${r"#"}{request.comment,jdbcType=VARCHAR},
|
||||
`RESOURCE_TYPE` = ${r"#"}{request.resourceType,jdbcType=VARCHAR},
|
||||
`VALID` = ${r"#"}{request.valid,jdbcType=BIT},
|
||||
`ROW_VERSION` = `ROW_VERSION` + 1,
|
||||
`LAST_UPDATE_BY` = ${r"#"}{token.userId},
|
||||
`LAST_UPDATE_TIME` = sysdate()
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#"}{request.id}
|
||||
AND `ROW_VERSION` = ${r"#"}{request.rowVersion}
|
||||
</update>
|
||||
|
||||
<select id="get" resultMap="resource">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#"}{request.id}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,74 @@
|
||||
package ${basePackage}.module.system.mpr;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ${basePackage}.module.system.ent.Tokens;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
|
||||
/**
|
||||
* TOKENS - 通行证
|
||||
*
|
||||
* @author author
|
||||
* @date 2019-12-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface TokensMapper {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insert(@Param("request") Tokens request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insertBatch(@Param("list") List<Tokens> request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long delete(@Param("request") TokensDeleteRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long update(@Param("request") TokensUpdateRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
List<Tokens> find(@Param("request") TokensFindRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
Tokens get(@Param("request") TokensGetRequest request, @Param("token") Token token);
|
||||
}
|
@ -0,0 +1,189 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${basePackage}.module.system.mpr.TokensMapper">
|
||||
|
||||
<sql id="table">`SYS_TOKENS`</sql>
|
||||
|
||||
<sql id="entityColumnList">
|
||||
`ID`,`USER_ID`,`USER_NAME`,`LOGIN_TIME`,`VALID_TIME`,`VALID`,`DEPT_ID`,`DEPT_CODE`,`DEPT_NAME`,`TERMINAL_TYPE`,`TERMINAL_IP`,`TERMINAL_INFO`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME`
|
||||
</sql>
|
||||
|
||||
<resultMap id="tokens" type="${basePackage}.module.system.ent.Tokens">
|
||||
<result column="ID" jdbcType="BIGINT" property="id"/>
|
||||
<result column="USER_ID" jdbcType="BIGINT" property="userId"/>
|
||||
<result column="USER_NAME" jdbcType="VARCHAR" property="userName"/>
|
||||
<result column="LOGIN_TIME" jdbcType="TIMESTAMP" property="loginTime"/>
|
||||
<result column="VALID_TIME" jdbcType="TIMESTAMP" property="validTime"/>
|
||||
<result column="VALID" jdbcType="BIT" property="valid"/>
|
||||
<result column="DEPT_ID" jdbcType="BIGINT" property="deptId"/>
|
||||
<result column="DEPT_CODE" jdbcType="VARCHAR" property="deptCode"/>
|
||||
<result column="DEPT_NAME" jdbcType="VARCHAR" property="deptName"/>
|
||||
<result column="TERMINAL_TYPE" jdbcType="VARCHAR" property="terminalType"/>
|
||||
<result column="TERMINAL_IP" jdbcType="VARCHAR" property="terminalIp"/>
|
||||
<result column="TERMINAL_INFO" jdbcType="VARCHAR" property="terminalInfo"/>
|
||||
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
|
||||
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
|
||||
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
|
||||
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="LAST_UPDATE_BY" jdbcType="BIGINT" property="lastUpdateBy"/>
|
||||
<result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="find" resultMap="tokens">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.userId != null and request.userId != 0">
|
||||
AND `USER_ID` = ${r"#"}{request.userId}
|
||||
</if>
|
||||
<if test="request.userName != null and request.userName != ''">
|
||||
AND `USER_NAME` = ${r"#"}{request.userName}
|
||||
</if>
|
||||
<if test="request.loginTime != null">
|
||||
AND DATE_FORMAT(`LOGIN_TIME`,"%Y-%m-%d %T") = DATE_FORMAT(${r"#"}{request.loginTime},"%Y-%m-%d %T")
|
||||
</if>
|
||||
<if test="request.validTime != null">
|
||||
AND DATE_FORMAT(`VALID_TIME`,"%Y-%m-%d %T") = DATE_FORMAT(${r"#"}{request.validTime},"%Y-%m-%d %T")
|
||||
</if>
|
||||
<if test="request.valid != null">
|
||||
AND `VALID` = ${r"#"}{request.valid}
|
||||
</if>
|
||||
<if test="request.deptId != null and request.deptId != 0">
|
||||
AND `DEPT_ID` = ${r"#"}{request.deptId}
|
||||
</if>
|
||||
<if test="request.deptCode != null and request.deptCode != ''">
|
||||
AND `DEPT_CODE` = ${r"#"}{request.deptCode}
|
||||
</if>
|
||||
<if test="request.deptName != null and request.deptName != ''">
|
||||
AND `DEPT_NAME` = ${r"#"}{request.deptName}
|
||||
</if>
|
||||
<if test="request.terminalType != null and request.terminalType != ''">
|
||||
AND `TERMINAL_TYPE` = ${r"#"}{request.terminalType}
|
||||
</if>
|
||||
<if test="request.terminalIp != null and request.terminalIp != ''">
|
||||
AND `TERMINAL_IP` = ${r"#"}{request.terminalIp}
|
||||
</if>
|
||||
<if test="request.terminalInfo != null and request.terminalInfo != ''">
|
||||
AND `TERMINAL_INFO` = ${r"#"}{request.terminalInfo}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="search" resultMap="tokens">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
1 = 2
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
${r"#"}{request.id},
|
||||
${r"#"}{request.userId,jdbcType=BIGINT},
|
||||
${r"#"}{request.userName,jdbcType=VARCHAR},
|
||||
${r"#"}{request.loginTime,jdbcType=TIMESTAMP},
|
||||
${r"#"}{request.validTime,jdbcType=TIMESTAMP},
|
||||
${r"#"}{request.valid,jdbcType=BIT},
|
||||
${r"#"}{request.deptId,jdbcType=BIGINT},
|
||||
${r"#"}{request.deptCode,jdbcType=VARCHAR},
|
||||
${r"#"}{request.deptName,jdbcType=VARCHAR},
|
||||
${r"#"}{request.terminalType,jdbcType=VARCHAR},
|
||||
${r"#"}{request.terminalIp,jdbcType=VARCHAR},
|
||||
${r"#"}{request.terminalInfo,jdbcType=VARCHAR},
|
||||
0,
|
||||
0,
|
||||
${r"#"}{token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item= "item" index ="index" separator=",">
|
||||
(
|
||||
${r"#"}{item.id},
|
||||
${r"#"}{item.userId,jdbcType=BIGINT},
|
||||
${r"#"}{item.userName,jdbcType=VARCHAR},
|
||||
${r"#"}{item.loginTime,jdbcType=TIMESTAMP},
|
||||
${r"#"}{item.validTime,jdbcType=TIMESTAMP},
|
||||
${r"#"}{item.valid,jdbcType=BIT},
|
||||
${r"#"}{item.deptId,jdbcType=BIGINT},
|
||||
${r"#"}{item.deptCode,jdbcType=VARCHAR},
|
||||
${r"#"}{item.deptName,jdbcType=VARCHAR},
|
||||
${r"#"}{item.terminalType,jdbcType=VARCHAR},
|
||||
${r"#"}{item.terminalIp,jdbcType=VARCHAR},
|
||||
${r"#"}{item.terminalInfo,jdbcType=VARCHAR},
|
||||
0,
|
||||
0,
|
||||
${r"#"}{token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</foreach >
|
||||
</insert>
|
||||
|
||||
<update id="delete">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET `IS_DELETED` = 1
|
||||
WHERE `IS_DELETED` = 0
|
||||
AND `ID` = ${r"#"}{request.id}
|
||||
</update>
|
||||
|
||||
<update id="update">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET
|
||||
`USER_ID` = ${r"#"}{request.userId,jdbcType=BIGINT},
|
||||
`USER_NAME` = ${r"#"}{request.userName,jdbcType=VARCHAR},
|
||||
`LOGIN_TIME` = ${r"#"}{request.loginTime,jdbcType=TIMESTAMP},
|
||||
`VALID_TIME` = ${r"#"}{request.validTime,jdbcType=TIMESTAMP},
|
||||
`VALID` = ${r"#"}{request.valid,jdbcType=BIT},
|
||||
`DEPT_ID` = ${r"#"}{request.deptId,jdbcType=BIGINT},
|
||||
`DEPT_CODE` = ${r"#"}{request.deptCode,jdbcType=VARCHAR},
|
||||
`DEPT_NAME` = ${r"#"}{request.deptName,jdbcType=VARCHAR},
|
||||
`TERMINAL_TYPE` = ${r"#"}{request.terminalType,jdbcType=VARCHAR},
|
||||
`TERMINAL_IP` = ${r"#"}{request.terminalIp,jdbcType=VARCHAR},
|
||||
`TERMINAL_INFO` = ${r"#"}{request.terminalInfo,jdbcType=VARCHAR},
|
||||
`ROW_VERSION` = `ROW_VERSION` + 1,
|
||||
`LAST_UPDATE_BY` = ${r"#"}{token.userId},
|
||||
`LAST_UPDATE_TIME` = sysdate()
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#"}{request.id}
|
||||
AND `ROW_VERSION` = ${r"#"}{request.rowVersion}
|
||||
</update>
|
||||
|
||||
<select id="get" resultMap="tokens">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#"}{request.id}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,75 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* ResourceCreateRequest - 资源新增
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 资源内容
|
||||
*/
|
||||
@NotEmpty(message = "资源内容不能为空")
|
||||
@Length(min = 0, max = 100, message = "资源内容长度不合法(0-100)")
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 资源描述
|
||||
*/
|
||||
@Length(min = 0, max = 255, message = "资源描述长度不合法(0-255)")
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
@NotEmpty(message = "资源类型不能为NULL")
|
||||
@Dict(name = "RESOURCE_TYPE")
|
||||
private String resourceType;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return this.comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getResourceType() {
|
||||
return this.resourceType;
|
||||
}
|
||||
|
||||
public void setResourceType(String resourceType) {
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* ResourceDeleteRequest - 资源删除
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* ResourceRequest - 资源查询
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 资源内容
|
||||
*/
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 资源描述
|
||||
*/
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
@Dict(name = "RESOURCE_TYPE")
|
||||
private String resourceType;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return this.comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getResourceType() {
|
||||
return this.resourceType;
|
||||
}
|
||||
|
||||
public void setResourceType(String resourceType) {
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* ResourceGetRequest - 资源获取
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* ResourceUpdateRequest - 资源更新
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 资源内容
|
||||
*/
|
||||
@NotEmpty(message = "资源内容不能为空")
|
||||
@Length(min = 0, max = 100, message = "资源内容长度不合法(0-100)")
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 资源描述
|
||||
*/
|
||||
@Length(min = 0, max = 255, message = "资源描述长度不合法(0-255)")
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
@NotNull(message = "资源类型不能为NULL")
|
||||
@Dict(name = "RESOURCE_TYPE")
|
||||
private String resourceType;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return this.comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getResourceType() {
|
||||
return this.resourceType;
|
||||
}
|
||||
|
||||
public void setResourceType(String resourceType) {
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,172 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import java.util.Date;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* TokensCreateRequest - 通行证新增
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 用户主键
|
||||
*/
|
||||
@NotNull(message = "用户主键不能为NULL")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@NotEmpty(message = "用户名称不能为空")
|
||||
@Length(min = 0, max = 50, message = "用户名称长度不合法(0-50)")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
@NotNull(message = "登录时间不能为NULL")
|
||||
private Date loginTime;
|
||||
|
||||
/**
|
||||
* 有效时间
|
||||
*/
|
||||
@NotNull(message = "有效时间不能为NULL")
|
||||
private Date validTime;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
/**
|
||||
* 部门主键
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门代码
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "部门代码长度不合法(0-50)")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "部门名称长度不合法(0-100)")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
*/
|
||||
@Dict(name = "TERMINAL_TYPE")
|
||||
private String terminalType;
|
||||
|
||||
/**
|
||||
* 终端地址
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "终端地址长度不合法(0-50)")
|
||||
private String terminalIp;
|
||||
|
||||
/**
|
||||
* 终端信息
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "终端信息长度不合法(0-100)")
|
||||
private String terminalInfo;
|
||||
|
||||
public Long getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return this.userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public Date getLoginTime() {
|
||||
return this.loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(Date loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public Date getValidTime() {
|
||||
return this.validTime;
|
||||
}
|
||||
|
||||
public void setValidTime(Date validTime) {
|
||||
this.validTime = validTime;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return this.deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getTerminalType() {
|
||||
return this.terminalType;
|
||||
}
|
||||
|
||||
public void setTerminalType(String terminalType) {
|
||||
this.terminalType = terminalType;
|
||||
}
|
||||
|
||||
public String getTerminalIp() {
|
||||
return this.terminalIp;
|
||||
}
|
||||
|
||||
public void setTerminalIp(String terminalIp) {
|
||||
this.terminalIp = terminalIp;
|
||||
}
|
||||
|
||||
public String getTerminalInfo() {
|
||||
return this.terminalInfo;
|
||||
}
|
||||
|
||||
public void setTerminalInfo(String terminalInfo) {
|
||||
this.terminalInfo = terminalInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* TokensDeleteRequest - 通行证删除
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,159 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
import java.util.Date;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* TokensRequest - 通行证查询
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 用户主键
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
private Date loginTime;
|
||||
|
||||
/**
|
||||
* 有效时间
|
||||
*/
|
||||
private Date validTime;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
/**
|
||||
* 部门主键
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门代码
|
||||
*/
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
*/
|
||||
@Dict(name = "TERMINAL_TYPE")
|
||||
private String terminalType;
|
||||
|
||||
/**
|
||||
* 终端地址
|
||||
*/
|
||||
private String terminalIp;
|
||||
|
||||
/**
|
||||
* 终端信息
|
||||
*/
|
||||
private String terminalInfo;
|
||||
|
||||
public Long getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return this.userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public Date getLoginTime() {
|
||||
return this.loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(Date loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public Date getValidTime() {
|
||||
return this.validTime;
|
||||
}
|
||||
|
||||
public void setValidTime(Date validTime) {
|
||||
this.validTime = validTime;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return this.deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getTerminalType() {
|
||||
return this.terminalType;
|
||||
}
|
||||
|
||||
public void setTerminalType(String terminalType) {
|
||||
this.terminalType = terminalType;
|
||||
}
|
||||
|
||||
public String getTerminalIp() {
|
||||
return this.terminalIp;
|
||||
}
|
||||
|
||||
public void setTerminalIp(String terminalIp) {
|
||||
this.terminalIp = terminalIp;
|
||||
}
|
||||
|
||||
public String getTerminalInfo() {
|
||||
return this.terminalInfo;
|
||||
}
|
||||
|
||||
public void setTerminalInfo(String terminalInfo) {
|
||||
this.terminalInfo = terminalInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* TokensGetRequest - 通行证获取
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,186 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.Date;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* TokensUpdateRequest - 通行证更新
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户主键
|
||||
*/
|
||||
@NotNull(message = "用户主键不能为NULL")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@NotEmpty(message = "用户名称不能为空")
|
||||
@Length(min = 0, max = 50, message = "用户名称长度不合法(0-50)")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
@NotNull(message = "登录时间不能为NULL")
|
||||
private Date loginTime;
|
||||
|
||||
/**
|
||||
* 有效时间
|
||||
*/
|
||||
@NotNull(message = "有效时间不能为NULL")
|
||||
private Date validTime;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
/**
|
||||
* 部门主键
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门代码
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "部门代码长度不合法(0-50)")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "部门名称长度不合法(0-100)")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
*/
|
||||
@Dict(name = "TERMINAL_TYPE")
|
||||
private String terminalType;
|
||||
|
||||
/**
|
||||
* 终端地址
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "终端地址长度不合法(0-50)")
|
||||
private String terminalIp;
|
||||
|
||||
/**
|
||||
* 终端信息
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "终端信息长度不合法(0-100)")
|
||||
private String terminalInfo;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return this.userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public Date getLoginTime() {
|
||||
return this.loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(Date loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public Date getValidTime() {
|
||||
return this.validTime;
|
||||
}
|
||||
|
||||
public void setValidTime(Date validTime) {
|
||||
this.validTime = validTime;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return this.deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getTerminalType() {
|
||||
return this.terminalType;
|
||||
}
|
||||
|
||||
public void setTerminalType(String terminalType) {
|
||||
this.terminalType = terminalType;
|
||||
}
|
||||
|
||||
public String getTerminalIp() {
|
||||
return this.terminalIp;
|
||||
}
|
||||
|
||||
public void setTerminalIp(String terminalIp) {
|
||||
this.terminalIp = terminalIp;
|
||||
}
|
||||
|
||||
public String getTerminalInfo() {
|
||||
return this.terminalInfo;
|
||||
}
|
||||
|
||||
public void setTerminalInfo(String terminalInfo) {
|
||||
this.terminalInfo = terminalInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* ResourceCreateResponse - 资源
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceCreateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* ResourceDeleteResponse - 资源
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceDeleteResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 删除数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindResponse;
|
||||
import ${basePackage}.module.system.ent.Resource;
|
||||
|
||||
/**
|
||||
* ResourceFindResponse - 资源
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceFindResponse extends BaseFindResponse<Resource> {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.module.system.ent.Resource;
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* ResourceGetResponse - 资源
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceGetResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 资源
|
||||
*/
|
||||
private Resource resource;
|
||||
|
||||
public Resource getResource() {
|
||||
return this.resource;
|
||||
}
|
||||
|
||||
public void setResource(Resource resource) {
|
||||
this.resource = resource;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* ResourceUpdateResponse - 资源
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class ResourceUpdateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 更新数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* TokensCreateResponse - 通行证
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensCreateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* TokensDeleteResponse - 通行证
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensDeleteResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 删除数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindResponse;
|
||||
import ${basePackage}.module.system.ent.Tokens;
|
||||
|
||||
/**
|
||||
* TokensFindResponse - 通行证
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensFindResponse extends BaseFindResponse<Tokens> {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.module.system.ent.Tokens;
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* TokensGetResponse - 通行证
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensGetResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 通行证
|
||||
*/
|
||||
private Tokens tokens;
|
||||
|
||||
public Tokens getTokens() {
|
||||
return this.tokens;
|
||||
}
|
||||
|
||||
public void setTokens(Tokens tokens) {
|
||||
this.tokens = tokens;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* TokensUpdateResponse - 通行证
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-19
|
||||
*/
|
||||
public class TokensUpdateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 更新数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for RESOURCE - 资源
|
||||
-- Target : MySQL
|
||||
-- Author : author
|
||||
-- Date: : 2019-12-19
|
||||
-- ----------------------------
|
||||
CREATE TABLE `SYS_RESOURCE` (
|
||||
`ID` BIGINT(20) NOT NULL COMMENT '主键',
|
||||
`VALUE` VARCHAR(100) NOT NULL COMMENT '资源内容',
|
||||
`COMMENT` VARCHAR(250) COMMENT '资源描述',
|
||||
`RESOURCE_TYPE` VARCHAR(20) NOT NULL COMMENT '资源类型',
|
||||
`VALID` TINYINT(1) NOT NULL COMMENT '是否有效',
|
||||
`ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本',
|
||||
`IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除',
|
||||
`CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户',
|
||||
`CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间',
|
||||
`LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户',
|
||||
`LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源';
|
@ -0,0 +1,27 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for TOKENS - 通行证
|
||||
-- Target : MySQL
|
||||
-- Author : author
|
||||
-- Date: : 2019-12-19
|
||||
-- ----------------------------
|
||||
CREATE TABLE `SYS_TOKENS` (
|
||||
`ID` BIGINT(20) NOT NULL COMMENT '主键',
|
||||
`USER_ID` BIGINT(20) NOT NULL COMMENT '用户主键',
|
||||
`USER_NAME` VARCHAR(50) NOT NULL COMMENT '用户名称',
|
||||
`LOGIN_TIME` DATETIME NOT NULL COMMENT '登录时间',
|
||||
`VALID_TIME` DATETIME NOT NULL COMMENT '有效时间',
|
||||
`VALID` TINYINT(1) NOT NULL COMMENT '是否有效',
|
||||
`DEPT_ID` BIGINT(20) COMMENT '部门主键',
|
||||
`DEPT_CODE` VARCHAR(50) COMMENT '部门代码',
|
||||
`DEPT_NAME` VARCHAR(100) COMMENT '部门名称',
|
||||
`TERMINAL_TYPE` VARCHAR(20) COMMENT '终端类型',
|
||||
`TERMINAL_IP` VARCHAR(50) COMMENT '终端地址',
|
||||
`TERMINAL_INFO` VARCHAR(100) COMMENT '终端信息',
|
||||
`ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本',
|
||||
`IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除',
|
||||
`CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户',
|
||||
`CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间',
|
||||
`LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户',
|
||||
`LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='通行证';
|
@ -0,0 +1,238 @@
|
||||
<div id="app" v-cloak>
|
||||
<el-card class="box-card search">
|
||||
<el-form :inline="true" :model="vm" ref="vm" label-position="left" label-width="90px">
|
||||
<el-form-item label="资源内容" prop="value">
|
||||
<el-input v-model="vm.value" clearable size="small" placeholder="请输入资源内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="资源描述" prop="comment">
|
||||
<el-input v-model="vm.comment" clearable size="small" placeholder="请输入资源描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="资源类型" prop="resourceType">
|
||||
<el-input-dict v-model="vm.resourceType" clearable size="small" placeholder="请输入资源类型" dict-name="RESOURCE_TYPE" ></el-input-dict>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有效" prop="valid">
|
||||
<el-radio-group v-model="vm.valid" clearable size="small">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="onSearch">搜索</el-button>
|
||||
<el-button type="warning" size="small" icon="el-icon-refresh-left" @click="onReset('vm')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-button type="success" size="small" icon="el-icon-plus" @click="onCreate">新增</el-button>
|
||||
|
||||
<el-button type="warning" size="small" icon="el-icon-download" @click="onExport">导出</el-button>
|
||||
|
||||
<el-dialog class="form" :title="form.title" :visible.sync="form.dialog">
|
||||
<el-form :model="form" :inline="true" :rules="formRules" ref="form" label-position="left" label-width="90px">
|
||||
<el-form-item label="资源内容" prop="value">
|
||||
<el-input v-model="form.value" clearable size="small" placeholder="请输入资源内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="资源描述" prop="comment">
|
||||
<el-input v-model="form.comment" clearable size="small" placeholder="请输入资源描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="资源类型" prop="resourceType">
|
||||
<el-input-dict v-model="form.resourceType" clearable size="small" placeholder="请输入资源类型" dict-name="RESOURCE_TYPE" ></el-input-dict>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有效" prop="valid">
|
||||
<el-radio-group v-model="form.valid" clearable size="small">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="form.dialog = false">取 消</el-button>
|
||||
<el-button size="small" type="primary" @click="onSave">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-button-group style="float: right;">
|
||||
<el-tooltip effect="dark" content="Excel模板下载" placement="bottom">
|
||||
<el-button size="small" icon="el-icon-date" @click="onTemplate"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip effect="dark" content="Excel导入" placement="bottom">
|
||||
<el-button size="small" icon="el-icon-upload2" @click="onImport"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip effect="dark" content="批量删除" placement="bottom">
|
||||
<el-button size="small" icon="el-icon-delete" @click="onBitchDelete"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip effect="dark" content="刷新" placement="bottom">
|
||||
<el-button size="small" icon="el-icon-refresh" @click="onFind"></el-button>
|
||||
</el-tooltip>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
style="margin-top: 10px"
|
||||
@selection-change="onSelectionChange"
|
||||
empty-text="无数据"
|
||||
:data="result"
|
||||
size="mini"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
align="center"
|
||||
type="selection"
|
||||
width="40">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="id"
|
||||
label="主键"
|
||||
width="140">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="valid"
|
||||
label="是否有效">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" v-if="scope.row.valid">有效</el-tag>
|
||||
<el-tag size="mini" type="danger" v-if="!scope.row.valid">无效</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="value"
|
||||
label="资源内容">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="comment"
|
||||
label="资源描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="resourceType"
|
||||
label="资源类型">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="140"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
fixed="right"
|
||||
width="120"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown size="mini" split-button type="primary" @click="onCommand(['edit',scope.row])"
|
||||
@command="onCommand">
|
||||
<i class="el-icon-edit"></i>编辑
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="['delete',scope.row]" icon="el-icon-delete">删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
background
|
||||
v-if="vm.totalCount > vm.pageSize"
|
||||
style="margin-top: 10px"
|
||||
@current-change="onPage"
|
||||
:current-page="vm.pageNumber"
|
||||
:page-size="vm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="vm.totalCount">
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
</div>
|
||||
<script>
|
||||
var app = new Vue({
|
||||
mixins: [mixin],
|
||||
el: "#app",
|
||||
data: {
|
||||
module: 'system',
|
||||
target: 'resource',
|
||||
vm: {//条件及分页参数
|
||||
value: "",
|
||||
comment: "",
|
||||
resourceType: "",
|
||||
valid: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
sortKey:'CREATE_TIME',
|
||||
sortType:'DESC'
|
||||
},
|
||||
form: {//待提交表单
|
||||
title: "",
|
||||
dialog: false,
|
||||
id: '',
|
||||
value: "",
|
||||
comment: "",
|
||||
resourceType: "",
|
||||
valid: "",
|
||||
rowVersion: ""
|
||||
},
|
||||
formRules: {
|
||||
value: [
|
||||
{required: true, message: '资源内容不能为空', trigger: 'blur'},
|
||||
{min: 1, max: 100, message: '资源内容长度在 1 到 100 个字符', trigger: 'blur'}
|
||||
],
|
||||
comment: [
|
||||
{min: 1, max: 255, message: '资源描述长度在 1 到 255 个字符', trigger: 'blur'}
|
||||
],
|
||||
resourceType: [
|
||||
{required: true, message: '资源类型不能为空', trigger: 'blur'},
|
||||
],
|
||||
valid: [
|
||||
{required: true, message: '是否有效不能为空', trigger: 'blur'},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCreate: function () {
|
||||
this.form.title = "资源新增";
|
||||
this.form.dialog = true;
|
||||
this.form.id = "";
|
||||
this.form.value = "";
|
||||
this.form.comment = "";
|
||||
this.form.resourceType = "";
|
||||
this.form.valid = true;
|
||||
},
|
||||
onCommand: function (arg) {
|
||||
const cmd = arg[0];
|
||||
const item = arg[1];
|
||||
switch (cmd) {
|
||||
case "edit":
|
||||
this.form.title = "资源编辑";
|
||||
this.form.dialog = true;
|
||||
this.form.id = item.id;
|
||||
this.form.value = item.value;
|
||||
this.form.comment = item.comment;
|
||||
this.form.resourceType = item.resourceType;
|
||||
this.form.valid = item.valid;
|
||||
this.form.rowVersion = item.rowVersion;
|
||||
break;
|
||||
case "delete":
|
||||
this.onDelete(item);
|
||||
break;
|
||||
default:
|
||||
this.w("未找到对应的命令");
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
this.onFind();
|
||||
},
|
||||
})
|
||||
</script>
|
@ -0,0 +1,368 @@
|
||||
<div id="app" v-cloak>
|
||||
<el-card class="box-card search">
|
||||
<el-form :inline="true" :model="vm" ref="vm" label-position="left" label-width="90px">
|
||||
<el-form-item label="用户主键" prop="userId">
|
||||
<el-input v-model="vm.userId" clearable size="small" placeholder="请输入用户主键"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input v-model="vm.userName" clearable size="small" placeholder="请输入用户名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="登录时间" prop="loginTime">
|
||||
<el-date-picker
|
||||
size="small"
|
||||
v-model="vm.loginTime"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有效" prop="valid">
|
||||
<el-radio-group v-model="vm.valid" clearable size="small">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="部门名称" prop="deptName">
|
||||
<el-input v-model="vm.deptName" clearable size="small" placeholder="请输入部门名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端类型" prop="terminalType">
|
||||
<el-input-dict v-model="vm.terminalType" clearable size="small" placeholder="请输入终端类型" dict-name="TERMINAL_TYPE" ></el-input-dict>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="onSearch">搜索</el-button>
|
||||
<el-button type="warning" size="small" icon="el-icon-refresh-left" @click="onReset('vm')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-button type="success" size="small" icon="el-icon-plus" @click="onCreate">新增</el-button>
|
||||
|
||||
<el-button type="warning" size="small" icon="el-icon-download" @click="onExport">导出</el-button>
|
||||
|
||||
<el-dialog class="form" :title="form.title" :visible.sync="form.dialog">
|
||||
<el-form :model="form" :inline="true" :rules="formRules" ref="form" label-position="left" label-width="90px">
|
||||
<el-form-item label="用户主键" prop="userId">
|
||||
<el-input-number v-model="form.userId" clearable size="small" placeholder="请输入用户主键" :step="1" step-strictly></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input v-model="form.userName" clearable size="small" placeholder="请输入用户名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="登录时间" prop="loginTime">
|
||||
<el-date-picker
|
||||
size="small"
|
||||
v-model="form.loginTime"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="有效时间" prop="validTime">
|
||||
<el-date-picker
|
||||
size="small"
|
||||
v-model="form.validTime"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有效" prop="valid">
|
||||
<el-radio-group v-model="form.valid" clearable size="small">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="部门主键" prop="deptId">
|
||||
<el-input-number v-model="form.deptId" clearable size="small" placeholder="请输入部门主键" :step="1" step-strictly></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="部门代码" prop="deptCode">
|
||||
<el-input v-model="form.deptCode" clearable size="small" placeholder="请输入部门代码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="部门名称" prop="deptName">
|
||||
<el-input v-model="form.deptName" clearable size="small" placeholder="请输入部门名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端类型" prop="terminalType">
|
||||
<el-input-dict v-model="form.terminalType" clearable size="small" placeholder="请输入终端类型" dict-name="TERMINAL_TYPE" ></el-input-dict>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端地址" prop="terminalIp">
|
||||
<el-input v-model="form.terminalIp" clearable size="small" placeholder="请输入终端地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端信息" prop="terminalInfo">
|
||||
<el-input v-model="form.terminalInfo" clearable size="small" placeholder="请输入终端信息"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="form.dialog = false">取 消</el-button>
|
||||
<el-button size="small" type="primary" @click="onSave">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-button-group style="float: right;">
|
||||
<el-tooltip effect="dark" content="Excel模板下载" placement="bottom">
|
||||
<el-button size="small" icon="el-icon-date" @click="onTemplate"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip effect="dark" content="Excel导入" placement="bottom">
|
||||
<el-button size="small" icon="el-icon-upload2" @click="onImport"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip effect="dark" content="批量删除" placement="bottom">
|
||||
<el-button size="small" icon="el-icon-delete" @click="onBitchDelete"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip effect="dark" content="刷新" placement="bottom">
|
||||
<el-button size="small" icon="el-icon-refresh" @click="onFind"></el-button>
|
||||
</el-tooltip>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
style="margin-top: 10px"
|
||||
@selection-change="onSelectionChange"
|
||||
empty-text="无数据"
|
||||
:data="result"
|
||||
size="mini"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
align="center"
|
||||
type="selection"
|
||||
width="40">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="id"
|
||||
label="主键"
|
||||
width="140">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="valid"
|
||||
label="是否有效">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" v-if="scope.row.valid">有效</el-tag>
|
||||
<el-tag size="mini" type="danger" v-if="!scope.row.valid">无效</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="userId"
|
||||
label="用户主键">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="userName"
|
||||
label="用户名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="loginTime"
|
||||
label="登录时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="validTime"
|
||||
label="有效时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="deptId"
|
||||
label="部门主键">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="deptCode"
|
||||
label="部门代码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="deptName"
|
||||
label="部门名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="terminalType"
|
||||
label="终端类型">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="terminalIp"
|
||||
label="终端地址">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="terminalInfo"
|
||||
label="终端信息">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="140"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
fixed="right"
|
||||
width="120"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown size="mini" split-button type="primary" @click="onCommand(['edit',scope.row])"
|
||||
@command="onCommand">
|
||||
<i class="el-icon-edit"></i>编辑
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="['delete',scope.row]" icon="el-icon-delete">删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
background
|
||||
v-if="vm.totalCount > vm.pageSize"
|
||||
style="margin-top: 10px"
|
||||
@current-change="onPage"
|
||||
:current-page="vm.pageNumber"
|
||||
:page-size="vm.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="vm.totalCount">
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
</div>
|
||||
<script>
|
||||
var app = new Vue({
|
||||
mixins: [mixin],
|
||||
el: "#app",
|
||||
data: {
|
||||
module: 'system',
|
||||
target: 'tokens',
|
||||
vm: {//条件及分页参数
|
||||
userId: "",
|
||||
userName: "",
|
||||
loginTime: "",
|
||||
validTime: "",
|
||||
valid: "",
|
||||
deptId: "",
|
||||
deptCode: "",
|
||||
deptName: "",
|
||||
terminalType: "",
|
||||
terminalIp: "",
|
||||
terminalInfo: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
sortKey:'CREATE_TIME',
|
||||
sortType:'DESC'
|
||||
},
|
||||
form: {//待提交表单
|
||||
title: "",
|
||||
dialog: false,
|
||||
id: '',
|
||||
userId: "",
|
||||
userName: "",
|
||||
loginTime: "",
|
||||
validTime: "",
|
||||
valid: "",
|
||||
deptId: "",
|
||||
deptCode: "",
|
||||
deptName: "",
|
||||
terminalType: "",
|
||||
terminalIp: "",
|
||||
terminalInfo: "",
|
||||
rowVersion: ""
|
||||
},
|
||||
formRules: {
|
||||
userId: [
|
||||
{required: true, message: '用户主键不能为空', trigger: 'blur'},
|
||||
],
|
||||
userName: [
|
||||
{required: true, message: '用户名称不能为空', trigger: 'blur'},
|
||||
{min: 1, max: 50, message: '用户名称长度在 1 到 50 个字符', trigger: 'blur'}
|
||||
],
|
||||
loginTime: [
|
||||
{required: true, message: '登录时间不能为空', trigger: 'blur'},
|
||||
],
|
||||
validTime: [
|
||||
{required: true, message: '有效时间不能为空', trigger: 'blur'},
|
||||
],
|
||||
valid: [
|
||||
{required: true, message: '是否有效不能为空', trigger: 'blur'},
|
||||
],
|
||||
deptId: [
|
||||
],
|
||||
deptCode: [
|
||||
{min: 1, max: 50, message: '部门代码长度在 1 到 50 个字符', trigger: 'blur'}
|
||||
],
|
||||
deptName: [
|
||||
{min: 1, max: 100, message: '部门名称长度在 1 到 100 个字符', trigger: 'blur'}
|
||||
],
|
||||
terminalType: [
|
||||
],
|
||||
terminalIp: [
|
||||
{min: 1, max: 50, message: '终端地址长度在 1 到 50 个字符', trigger: 'blur'}
|
||||
],
|
||||
terminalInfo: [
|
||||
{min: 1, max: 100, message: '终端信息长度在 1 到 100 个字符', trigger: 'blur'}
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCreate: function () {
|
||||
this.form.title = "通行证新增";
|
||||
this.form.dialog = true;
|
||||
this.form.id = "";
|
||||
this.form.userId = "";
|
||||
this.form.userName = "";
|
||||
this.form.loginTime = "";
|
||||
this.form.validTime = "";
|
||||
this.form.valid = "";
|
||||
this.form.deptId = "";
|
||||
this.form.deptCode = "";
|
||||
this.form.deptName = "";
|
||||
this.form.terminalType = "";
|
||||
this.form.terminalIp = "";
|
||||
this.form.terminalInfo = "";
|
||||
},
|
||||
onCommand: function (arg) {
|
||||
const cmd = arg[0];
|
||||
const item = arg[1];
|
||||
switch (cmd) {
|
||||
case "edit":
|
||||
this.form.title = "通行证编辑";
|
||||
this.form.dialog = true;
|
||||
this.form.id = item.id;
|
||||
this.form.userId = item.userId;
|
||||
this.form.userName = item.userName;
|
||||
this.form.loginTime = item.loginTime;
|
||||
this.form.validTime = item.validTime;
|
||||
this.form.valid = item.valid;
|
||||
this.form.deptId = item.deptId;
|
||||
this.form.deptCode = item.deptCode;
|
||||
this.form.deptName = item.deptName;
|
||||
this.form.terminalType = item.terminalType;
|
||||
this.form.terminalIp = item.terminalIp;
|
||||
this.form.terminalInfo = item.terminalInfo;
|
||||
this.form.rowVersion = item.rowVersion;
|
||||
break;
|
||||
case "delete":
|
||||
this.onDelete(item);
|
||||
break;
|
||||
default:
|
||||
this.w("未找到对应的命令");
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
this.onFind();
|
||||
},
|
||||
})
|
||||
</script>
|
Loading…
Reference in new issue