parent
20d8db6ce8
commit
ee6fa2b805
@ -1,9 +1,12 @@
|
||||
package cn.iocoder.mall.system.biz.enums.admin;
|
||||
package cn.iocoder.mall.systemservice.enums.admin;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 管理员的状态枚举
|
||||
*/
|
||||
public enum AdminStatusEnum implements IntArrayValuable {
|
||||
|
||||
ACTIVE(1, "在职"),
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.system.biz.enums.authorization;
|
||||
package cn.iocoder.mall.systemservice.enums.permission;
|
||||
|
||||
/**
|
||||
* Resource 编号枚举
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.system.biz.enums.authorization;
|
||||
package cn.iocoder.mall.systemservice.enums.permission;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.system.biz.enums.authorization;
|
||||
package cn.iocoder.mall.systemservice.enums.permission;
|
||||
|
||||
public enum RoleCodeEnum {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.system.biz.enums.authorization;
|
||||
package cn.iocoder.mall.systemservice.enums.permission;
|
||||
|
||||
public enum RoleTypeEnum {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.system.biz.dataobject.authorization;
|
||||
package cn.iocoder.mall.systemservice.dal.mysql.dataobject.permission;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.DeletableDO;
|
||||
import cn.iocoder.mall.system.biz.dataobject.account.AccountDO;
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.system.biz.dataobject.authorization;
|
||||
package cn.iocoder.mall.systemservice.dal.mysql.dataobject.permission;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.DeletableDO;
|
||||
import cn.iocoder.mall.system.biz.enums.authorization.ResourceTypeEnum;
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.system.biz.dataobject.authorization;
|
||||
package cn.iocoder.mall.systemservice.dal.mysql.dataobject.permission;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.DeletableDO;
|
||||
import cn.iocoder.mall.system.biz.enums.authorization.RoleCodeEnum;
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.system.biz.dataobject.authorization;
|
||||
package cn.iocoder.mall.systemservice.dal.mysql.dataobject.permission;
|
||||
|
||||
import cn.iocoder.mall.mybatis.dataobject.DeletableDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.mall.systemservice.dal.mysql.mapper.admin;
|
||||
|
||||
import cn.iocoder.mall.systemservice.dal.mysql.dataobject.admin.AdminDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface AdminMapper extends BaseMapper<AdminDO> {
|
||||
|
||||
default AdminDO selectByUsername(String username) {
|
||||
return selectOne(new QueryWrapper<AdminDO>()
|
||||
.eq("username", username)
|
||||
);
|
||||
}
|
||||
|
||||
// default IPage<AdminDO> selectPage(AdminPageDTO adminPageDTO) {
|
||||
// return selectPage(new Page<>(adminPageDTO.getPageNo(), adminPageDTO.getPageSize()),
|
||||
// new QueryWrapperX<AdminDO>().likeIfPresent("name", adminPageDTO.getName())
|
||||
// .eqIfPresent("department_id", adminPageDTO.getDepartmentId()));
|
||||
// }
|
||||
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.mall.system.biz.dao.authorization;
|
||||
package cn.iocoder.mall.systemservice.dal.mysql.mapper.permission;
|
||||
|
||||
import cn.iocoder.mall.mybatis.query.QueryWrapperX;
|
||||
import cn.iocoder.mall.system.biz.dataobject.authorization.ResourceDO;
|
||||
import cn.iocoder.mall.systemservice.dal.mysql.dataobject.permission.ResourceDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@ -1,6 +1,6 @@
|
||||
package cn.iocoder.mall.system.biz.dao.authorization;
|
||||
package cn.iocoder.mall.systemservice.dal.mysql.mapper.permission;
|
||||
|
||||
import cn.iocoder.mall.system.biz.dataobject.authorization.RoleResourceDO;
|
||||
import cn.iocoder.mall.systemservice.dal.mysql.dataobject.permission.RoleResourceDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -1,6 +1,6 @@
|
||||
<?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="cn.iocoder.mall.system.biz.dao.authorization.AccountRoleMapper">
|
||||
<mapper namespace="cn.iocoder.mall.systemservice.dal.mysql.mapper.permission.AccountRoleMapper">
|
||||
|
||||
<insert id="insertList">
|
||||
INSERT INTO account_role (
|
||||
@ -1,6 +1,6 @@
|
||||
<?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="cn.iocoder.mall.system.biz.dao.authorization.RoleResourceMapper">
|
||||
<mapper namespace="cn.iocoder.mall.systemservice.dal.mysql.mapper.permission.RoleResourceMapper">
|
||||
|
||||
<insert id="insertList">
|
||||
INSERT INTO role_resource (
|
||||
@ -1,46 +0,0 @@
|
||||
package cn.iocoder.mall.system.biz.enums.user;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Author: jiangweifan
|
||||
* @Date: 2020/5/12
|
||||
* @Description: 用户状态枚举
|
||||
*/
|
||||
public enum UserStatusEnum implements IntArrayValuable {
|
||||
|
||||
ENABLED(1, "启用"),
|
||||
DISABLED(2, "禁用");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(UserStatusEnum::getStatus).toArray();
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
UserStatusEnum(Integer status, String name) {
|
||||
this.status = status;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package cn.iocoder.mall.system.biz.dao.account;
|
||||
|
||||
import cn.iocoder.mall.system.biz.dataobject.account.AccountDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface AccountMapper extends BaseMapper<AccountDO> {
|
||||
|
||||
default AccountDO selectByUsername(String username) {
|
||||
return selectOne(new QueryWrapper<AccountDO>()
|
||||
.eq("username", username)
|
||||
);
|
||||
}
|
||||
|
||||
default AccountDO selectByMobile(String mobile) {
|
||||
return selectOne(new QueryWrapper<AccountDO>()
|
||||
.eq("mobile", mobile)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
package cn.iocoder.mall.system.biz.dao.admin;
|
||||
|
||||
import cn.iocoder.mall.mybatis.query.QueryWrapperX;
|
||||
import cn.iocoder.mall.system.biz.dataobject.admin.AdminDO;
|
||||
import cn.iocoder.mall.system.biz.dto.admin.AdminPageDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface AdminMapper extends BaseMapper<AdminDO> {
|
||||
|
||||
default AdminDO selectByAccountId(Integer accountId) {
|
||||
return selectOne(new QueryWrapper<AdminDO>()
|
||||
.eq("account_id", accountId)
|
||||
);
|
||||
}
|
||||
|
||||
default IPage<AdminDO> selectPage(AdminPageDTO adminPageDTO) {
|
||||
return selectPage(new Page<>(adminPageDTO.getPageNo(), adminPageDTO.getPageSize()),
|
||||
new QueryWrapperX<AdminDO>().likeIfPresent("name", adminPageDTO.getName())
|
||||
.eqIfPresent("department_id", adminPageDTO.getDepartmentId()));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
package cn.iocoder.mall.system.biz.dataobject.account;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.mall.mybatis.dataobject.DeletableDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 账号实体
|
||||
*/
|
||||
@TableName(value = "account")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class AccountDO extends DeletableDO {
|
||||
|
||||
/**
|
||||
* 账号编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 登陆账号
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 密码
|
||||
*
|
||||
* // TODO 芋艿 暂时明文
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 账号状态
|
||||
*
|
||||
* 枚举 {@link CommonStatusEnum}
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建 IP
|
||||
*/
|
||||
private String createIp;
|
||||
/**
|
||||
* 最后登陆时间
|
||||
*/
|
||||
private Date lastLoginTime;
|
||||
/**
|
||||
* 最后登陆 IP
|
||||
*/
|
||||
private String lastLoginIp;
|
||||
/**
|
||||
* 登陆次数
|
||||
*/
|
||||
private Integer loginTimes;
|
||||
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
##################### 业务模块 #####################
|
||||
## OAuth2Service
|
||||
modules.oauth2-code-service.access-token-expire-time-millis = 2880000
|
||||
modules.oauth2-code-service.refresh-token-expire-time-millis = 43200000
|
||||
@ -1,19 +0,0 @@
|
||||
spring:
|
||||
# 数据源配置项
|
||||
datasource:
|
||||
url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_system?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: 3WLiVUBEwTbvAfsh
|
||||
|
||||
# MyBatis Plus 配置项
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: auto
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
mapper-locations: classpath*:mapper/*.xml
|
||||
type-aliases-package: cn.iocoder.mall.system.biz.dataobject
|
||||
Loading…
Reference in new issue