diff --git a/ifishMQ.iml b/ifishMQ.iml index 4ebb9b6..c2d4d54 100644 --- a/ifishMQ.iml +++ b/ifishMQ.iml @@ -20,7 +20,7 @@ - + @@ -37,13 +37,13 @@ - + @@ -62,6 +62,14 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml index 8b43526..5ee00e6 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,11 @@ [4.3.2,5.0.0) + + mysql + mysql-connector-java + 5.1.9 + @@ -137,6 +142,37 @@ ${mybatis-spring.version} + + commons-logging + commons-logging + 1.2 + + + + + com.baomidou + mybatis-plus-boot-starter + 3.1.0 + + + * + * + + + + + + com.baomidou + mybatis-plus-generator + 3.1.0 + + + + org.freemarker + freemarker + 2.3.28 + + com.alibaba @@ -194,7 +230,6 @@ ifishMQ ${basedir}/src/main/java - ${basedir}/src/main/webapp/WEB-INF/classes ${basedir}/src/main/resources diff --git a/src/main/java/com/ifish7/mq/business/device/entity/TblDevice.java b/src/main/java/com/ifish7/mq/business/device/entity/TblDevice.java new file mode 100644 index 0000000..5548d8a --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/entity/TblDevice.java @@ -0,0 +1,96 @@ +package com.ifish7.mq.business.device.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Data +@Accessors(chain = true) +public class TblDevice{ + + private static final long serialVersionUID = 1L; + + @TableId(value = "device_id", type = IdType.AUTO) + private Integer deviceId; + + private String serverIp; + + private String deviceIp; + + private String macAddress; + + private Integer loginCount; + + private LocalDateTime loginTime; + + private String isBlacklist; + + private LocalDateTime firstActivate; + + private LocalDateTime createTime; + + private String hardwareType; + + private String softwareVersion; + + private String onOff; + + private String todayRemind; + + private String waterRemind; + + private LocalDate remindDate; + + private Integer remindCycle; + + private String factoryCode; + + private String brandCode; + + private Integer sdkVersion; + + private LocalDate sdkTime; + + private LocalDate createDate; + + private String isUpgrade; + + private Integer upgradeVersion; + + private LocalDateTime upgradeTime; + + private LocalDateTime authorizeTime; + + private String createCode; + + private String isCharge; + + private Integer number1; + + private Integer number2; + + private Integer number3; + + private Integer number4; + + private Integer number5; + + /** + * 收费时间 + */ + private LocalDateTime chargeTime; + + +} diff --git a/src/main/java/com/ifish7/mq/business/device/entity/TblDeviceHeater.java b/src/main/java/com/ifish7/mq/business/device/entity/TblDeviceHeater.java new file mode 100644 index 0000000..3d31c6d --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/entity/TblDeviceHeater.java @@ -0,0 +1,56 @@ +package com.ifish7.mq.business.device.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + *

+ * + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Data +@Accessors(chain = true) +@TableName("tbl_device_heater") +public class TblDeviceHeater { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @TableId(value = "heater_id", type = IdType.AUTO) + private Integer heaterId; + + /** + * mac 地址 + */ + private String heaterMacAddress; + + /** + * 水温 + */ + private String heaterWaterTemperature; + + /** + * 水流量 + */ + private String heaterPh; + + /** + * 数据采集时间 + */ + private String heaterGatheringTime; + + /** + * 日期 + */ + private String heaterGatheringDate; + + +} diff --git a/src/main/java/com/ifish7/mq/business/device/entity/TblFactoryHardware.java b/src/main/java/com/ifish7/mq/business/device/entity/TblFactoryHardware.java new file mode 100644 index 0000000..1997260 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/entity/TblFactoryHardware.java @@ -0,0 +1,25 @@ +package com.ifish7.mq.business.device.entity; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + *

+ * + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Data +@Accessors(chain = true) +public class TblFactoryHardware { + + private static final long serialVersionUID = 1L; + + private String factoryCode; + + private String hardwareType; + + +} diff --git a/src/main/java/com/ifish7/mq/business/device/entity/TblFactoryList.java b/src/main/java/com/ifish7/mq/business/device/entity/TblFactoryList.java new file mode 100644 index 0000000..114be6c --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/entity/TblFactoryList.java @@ -0,0 +1,31 @@ +package com.ifish7.mq.business.device.entity; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Data +@Accessors(chain = true) +public class TblFactoryList { + + private static final long serialVersionUID = 1L; + + private String factoryCode; + + private String factoryName; + + private LocalDateTime createTime; + + private String isTax; + + +} diff --git a/src/main/java/com/ifish7/mq/business/device/entity/TblHardwareType.java b/src/main/java/com/ifish7/mq/business/device/entity/TblHardwareType.java new file mode 100644 index 0000000..0b37559 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/entity/TblHardwareType.java @@ -0,0 +1,55 @@ +package com.ifish7.mq.business.device.entity; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Data +@Accessors(chain = true) +public class TblHardwareType { + + private static final long serialVersionUID = 1L; + + private String hardwareType; + + private String hardwareName; + + private String hardwareDesc; + + private LocalDateTime createTime; + + private Integer controlAmount; + + private Integer timerAmount; + + private String isCustomIcon; + + private String iconLink; + + private String allIconName; + + private LocalDateTime updateTime; + + private String isLightness; + + private String isSarkLamp; + + private String isWorkModel; + + private String allShowName; + + private String defaultShowName; + + private String defaultIconName; + + +} diff --git a/src/main/java/com/ifish7/mq/business/device/mapper/TblDeviceHeaterMapper.java b/src/main/java/com/ifish7/mq/business/device/mapper/TblDeviceHeaterMapper.java new file mode 100644 index 0000000..abca3d0 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/mapper/TblDeviceHeaterMapper.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.mapper; + +import com.ifish7.mq.business.device.entity.TblDeviceHeater; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface TblDeviceHeaterMapper extends BaseMapper { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/mapper/TblDeviceMapper.java b/src/main/java/com/ifish7/mq/business/device/mapper/TblDeviceMapper.java new file mode 100644 index 0000000..438c76b --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/mapper/TblDeviceMapper.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.mapper; + +import com.ifish7.mq.business.device.entity.TblDevice; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface TblDeviceMapper extends BaseMapper { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/mapper/TblFactoryHardwareMapper.java b/src/main/java/com/ifish7/mq/business/device/mapper/TblFactoryHardwareMapper.java new file mode 100644 index 0000000..dee3572 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/mapper/TblFactoryHardwareMapper.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.mapper; + +import com.ifish7.mq.business.device.entity.TblFactoryHardware; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface TblFactoryHardwareMapper extends BaseMapper { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/mapper/TblFactoryListMapper.java b/src/main/java/com/ifish7/mq/business/device/mapper/TblFactoryListMapper.java new file mode 100644 index 0000000..c5a3fac --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/mapper/TblFactoryListMapper.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.mapper; + +import com.ifish7.mq.business.device.entity.TblFactoryList; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface TblFactoryListMapper extends BaseMapper { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/mapper/TblHardwareTypeMapper.java b/src/main/java/com/ifish7/mq/business/device/mapper/TblHardwareTypeMapper.java new file mode 100644 index 0000000..2d978c8 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/mapper/TblHardwareTypeMapper.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.mapper; + +import com.ifish7.mq.business.device.entity.TblHardwareType; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface TblHardwareTypeMapper extends BaseMapper { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/ITblDeviceHeaterService.java b/src/main/java/com/ifish7/mq/business/device/service/ITblDeviceHeaterService.java new file mode 100644 index 0000000..ed31c71 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/ITblDeviceHeaterService.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.service; + +import com.ifish7.mq.business.device.entity.TblDeviceHeater; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface ITblDeviceHeaterService extends IService { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/ITblDeviceService.java b/src/main/java/com/ifish7/mq/business/device/service/ITblDeviceService.java new file mode 100644 index 0000000..ae40a40 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/ITblDeviceService.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.service; + +import com.ifish7.mq.business.device.entity.TblDevice; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface ITblDeviceService extends IService { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/ITblFactoryHardwareService.java b/src/main/java/com/ifish7/mq/business/device/service/ITblFactoryHardwareService.java new file mode 100644 index 0000000..10a857a --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/ITblFactoryHardwareService.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.service; + +import com.ifish7.mq.business.device.entity.TblFactoryHardware; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface ITblFactoryHardwareService extends IService { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/ITblFactoryListService.java b/src/main/java/com/ifish7/mq/business/device/service/ITblFactoryListService.java new file mode 100644 index 0000000..25b8a52 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/ITblFactoryListService.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.service; + +import com.ifish7.mq.business.device.entity.TblFactoryList; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface ITblFactoryListService extends IService { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/ITblHardwareTypeService.java b/src/main/java/com/ifish7/mq/business/device/service/ITblHardwareTypeService.java new file mode 100644 index 0000000..cea97ba --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/ITblHardwareTypeService.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.device.service; + +import com.ifish7.mq.business.device.entity.TblHardwareType; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface ITblHardwareTypeService extends IService { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/impl/TblDeviceHeaterServiceImpl.java b/src/main/java/com/ifish7/mq/business/device/service/impl/TblDeviceHeaterServiceImpl.java new file mode 100644 index 0000000..8638060 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/impl/TblDeviceHeaterServiceImpl.java @@ -0,0 +1,20 @@ +package com.ifish7.mq.business.device.service.impl; + +import com.ifish7.mq.business.device.entity.TblDeviceHeater; +import com.ifish7.mq.business.device.mapper.TblDeviceHeaterMapper; +import com.ifish7.mq.business.device.service.ITblDeviceHeaterService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Service +public class TblDeviceHeaterServiceImpl extends ServiceImpl implements ITblDeviceHeaterService { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/impl/TblDeviceServiceImpl.java b/src/main/java/com/ifish7/mq/business/device/service/impl/TblDeviceServiceImpl.java new file mode 100644 index 0000000..c18355a --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/impl/TblDeviceServiceImpl.java @@ -0,0 +1,20 @@ +package com.ifish7.mq.business.device.service.impl; + +import com.ifish7.mq.business.device.entity.TblDevice; +import com.ifish7.mq.business.device.mapper.TblDeviceMapper; +import com.ifish7.mq.business.device.service.ITblDeviceService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Service +public class TblDeviceServiceImpl extends ServiceImpl implements ITblDeviceService { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/impl/TblFactoryHardwareServiceImpl.java b/src/main/java/com/ifish7/mq/business/device/service/impl/TblFactoryHardwareServiceImpl.java new file mode 100644 index 0000000..94a7c1e --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/impl/TblFactoryHardwareServiceImpl.java @@ -0,0 +1,20 @@ +package com.ifish7.mq.business.device.service.impl; + +import com.ifish7.mq.business.device.entity.TblFactoryHardware; +import com.ifish7.mq.business.device.mapper.TblFactoryHardwareMapper; +import com.ifish7.mq.business.device.service.ITblFactoryHardwareService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Service +public class TblFactoryHardwareServiceImpl extends ServiceImpl implements ITblFactoryHardwareService { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/impl/TblFactoryListServiceImpl.java b/src/main/java/com/ifish7/mq/business/device/service/impl/TblFactoryListServiceImpl.java new file mode 100644 index 0000000..7f4ed39 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/impl/TblFactoryListServiceImpl.java @@ -0,0 +1,20 @@ +package com.ifish7.mq.business.device.service.impl; + +import com.ifish7.mq.business.device.entity.TblFactoryList; +import com.ifish7.mq.business.device.mapper.TblFactoryListMapper; +import com.ifish7.mq.business.device.service.ITblFactoryListService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Service +public class TblFactoryListServiceImpl extends ServiceImpl implements ITblFactoryListService { + +} diff --git a/src/main/java/com/ifish7/mq/business/device/service/impl/TblHardwareTypeServiceImpl.java b/src/main/java/com/ifish7/mq/business/device/service/impl/TblHardwareTypeServiceImpl.java new file mode 100644 index 0000000..3ad64a6 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/device/service/impl/TblHardwareTypeServiceImpl.java @@ -0,0 +1,20 @@ +package com.ifish7.mq.business.device.service.impl; + +import com.ifish7.mq.business.device.entity.TblHardwareType; +import com.ifish7.mq.business.device.mapper.TblHardwareTypeMapper; +import com.ifish7.mq.business.device.service.ITblHardwareTypeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Service +public class TblHardwareTypeServiceImpl extends ServiceImpl implements ITblHardwareTypeService { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/entity/TblDeviceUser.java b/src/main/java/com/ifish7/mq/business/user/entity/TblDeviceUser.java new file mode 100644 index 0000000..7524aa4 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/entity/TblDeviceUser.java @@ -0,0 +1,39 @@ +package com.ifish7.mq.business.user.entity; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Data +@Accessors(chain = true) +public class TblDeviceUser { + + private static final long serialVersionUID = 1L; + + private Integer userId; + + private Integer deviceId; + + private String isMaster; + + private String showName; + + private LocalDateTime createTime; + + private LocalDateTime updateTime; + + private String customIconName; + + private String customShowName; + + +} diff --git a/src/main/java/com/ifish7/mq/business/user/entity/TblLoginRecord.java b/src/main/java/com/ifish7/mq/business/user/entity/TblLoginRecord.java new file mode 100644 index 0000000..928776e --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/entity/TblLoginRecord.java @@ -0,0 +1,32 @@ +package com.ifish7.mq.business.user.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Data +@Accessors(chain = true) +public class TblLoginRecord { + + private static final long serialVersionUID = 1L; + + @TableId(value = "record_id", type = IdType.AUTO) + private Integer recordId; + + private String macAddress; + + private LocalDateTime loginTime; + + +} diff --git a/src/main/java/com/ifish7/mq/business/user/entity/TblPushList.java b/src/main/java/com/ifish7/mq/business/user/entity/TblPushList.java new file mode 100644 index 0000000..896a173 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/entity/TblPushList.java @@ -0,0 +1,62 @@ +package com.ifish7.mq.business.user.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Data +@Accessors(chain = true) +public class TblPushList { + + private static final long serialVersionUID = 1L; + + @TableId(value = "push_id", type = IdType.AUTO) + private Integer pushId; + + private Integer userId; + + private Integer deviceId; + + private String showName; + + private String phoneType; + + private String pushType; + + private String pushTitle; + + private String pushContext; + + private LocalDateTime createTime; + + private String pushLink; + + private String jpushStatus; + + private String neteaseStatus; + + private Integer reportId; + + private Integer number1; + + private Integer number2; + + private Integer number3; + + private Integer number4; + + private Integer number5; + + +} diff --git a/src/main/java/com/ifish7/mq/business/user/entity/TblUser.java b/src/main/java/com/ifish7/mq/business/user/entity/TblUser.java new file mode 100644 index 0000000..ca2e109 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/entity/TblUser.java @@ -0,0 +1,80 @@ +package com.ifish7.mq.business.user.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Data +@Accessors(chain = true) +public class TblUser { + + private static final long serialVersionUID = 1L; + + @TableId(value = "user_id", type = IdType.AUTO) + private Integer userId; + + private String nickName; + + private String userPassword; + + private String phoneNumber; + + private String userImg; + + private String userSex; + + private String signature; + + private Integer loginCount; + + private String phoneType; + + private LocalDateTime updateTime; + + private LocalDateTime loginTime; + + private LocalDateTime createTime; + + private String loginType; + + private String remarks; + + private String address; + + @TableField("P2PVerify_code1") + private String p2pverifyCode1; + + @TableField("P2PVerify_code2") + private String p2pverifyCode2; + + @TableField("gwell_userID") + private String gwellUserid; + + private String isRegisterGwell; + + private String userType; + + private Integer shopsUserId; + + private String neteaseToken; + + private String isRegisterNetease; + + private Double latitude; + + private Double longitude; + + +} diff --git a/src/main/java/com/ifish7/mq/business/user/mapper/TblDeviceUserMapper.java b/src/main/java/com/ifish7/mq/business/user/mapper/TblDeviceUserMapper.java new file mode 100644 index 0000000..56a8ca4 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/mapper/TblDeviceUserMapper.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.user.mapper; + +import com.ifish7.mq.business.user.entity.TblDeviceUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface TblDeviceUserMapper extends BaseMapper { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/mapper/TblLoginRecordMapper.java b/src/main/java/com/ifish7/mq/business/user/mapper/TblLoginRecordMapper.java new file mode 100644 index 0000000..62b3259 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/mapper/TblLoginRecordMapper.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.user.mapper; + +import com.ifish7.mq.business.user.entity.TblLoginRecord; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface TblLoginRecordMapper extends BaseMapper { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/mapper/TblPushListMapper.java b/src/main/java/com/ifish7/mq/business/user/mapper/TblPushListMapper.java new file mode 100644 index 0000000..b53a0fd --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/mapper/TblPushListMapper.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.user.mapper; + +import com.ifish7.mq.business.user.entity.TblPushList; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface TblPushListMapper extends BaseMapper { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/mapper/TblUserMapper.java b/src/main/java/com/ifish7/mq/business/user/mapper/TblUserMapper.java new file mode 100644 index 0000000..d182b34 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/mapper/TblUserMapper.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.user.mapper; + +import com.ifish7.mq.business.user.entity.TblUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface TblUserMapper extends BaseMapper { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/service/ITblDeviceUserService.java b/src/main/java/com/ifish7/mq/business/user/service/ITblDeviceUserService.java new file mode 100644 index 0000000..cee8910 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/service/ITblDeviceUserService.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.user.service; + +import com.ifish7.mq.business.user.entity.TblDeviceUser; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface ITblDeviceUserService extends IService { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/service/ITblLoginRecordService.java b/src/main/java/com/ifish7/mq/business/user/service/ITblLoginRecordService.java new file mode 100644 index 0000000..ee400b7 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/service/ITblLoginRecordService.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.user.service; + +import com.ifish7.mq.business.user.entity.TblLoginRecord; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface ITblLoginRecordService extends IService { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/service/ITblPushListService.java b/src/main/java/com/ifish7/mq/business/user/service/ITblPushListService.java new file mode 100644 index 0000000..0716bd3 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/service/ITblPushListService.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.user.service; + +import com.ifish7.mq.business.user.entity.TblPushList; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface ITblPushListService extends IService { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/service/ITblUserService.java b/src/main/java/com/ifish7/mq/business/user/service/ITblUserService.java new file mode 100644 index 0000000..5d36716 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/service/ITblUserService.java @@ -0,0 +1,16 @@ +package com.ifish7.mq.business.user.service; + +import com.ifish7.mq.business.user.entity.TblUser; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +public interface ITblUserService extends IService { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/service/impl/TblDeviceUserServiceImpl.java b/src/main/java/com/ifish7/mq/business/user/service/impl/TblDeviceUserServiceImpl.java new file mode 100644 index 0000000..c52bfd6 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/service/impl/TblDeviceUserServiceImpl.java @@ -0,0 +1,20 @@ +package com.ifish7.mq.business.user.service.impl; + +import com.ifish7.mq.business.user.entity.TblDeviceUser; +import com.ifish7.mq.business.user.mapper.TblDeviceUserMapper; +import com.ifish7.mq.business.user.service.ITblDeviceUserService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Service +public class TblDeviceUserServiceImpl extends ServiceImpl implements ITblDeviceUserService { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/service/impl/TblLoginRecordServiceImpl.java b/src/main/java/com/ifish7/mq/business/user/service/impl/TblLoginRecordServiceImpl.java new file mode 100644 index 0000000..01cb1d3 --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/service/impl/TblLoginRecordServiceImpl.java @@ -0,0 +1,20 @@ +package com.ifish7.mq.business.user.service.impl; + +import com.ifish7.mq.business.user.entity.TblLoginRecord; +import com.ifish7.mq.business.user.mapper.TblLoginRecordMapper; +import com.ifish7.mq.business.user.service.ITblLoginRecordService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Service +public class TblLoginRecordServiceImpl extends ServiceImpl implements ITblLoginRecordService { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/service/impl/TblPushListServiceImpl.java b/src/main/java/com/ifish7/mq/business/user/service/impl/TblPushListServiceImpl.java new file mode 100644 index 0000000..dad17ed --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/service/impl/TblPushListServiceImpl.java @@ -0,0 +1,20 @@ +package com.ifish7.mq.business.user.service.impl; + +import com.ifish7.mq.business.user.entity.TblPushList; +import com.ifish7.mq.business.user.mapper.TblPushListMapper; +import com.ifish7.mq.business.user.service.ITblPushListService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Service +public class TblPushListServiceImpl extends ServiceImpl implements ITblPushListService { + +} diff --git a/src/main/java/com/ifish7/mq/business/user/service/impl/TblUserServiceImpl.java b/src/main/java/com/ifish7/mq/business/user/service/impl/TblUserServiceImpl.java new file mode 100644 index 0000000..3cbb11e --- /dev/null +++ b/src/main/java/com/ifish7/mq/business/user/service/impl/TblUserServiceImpl.java @@ -0,0 +1,20 @@ +package com.ifish7.mq.business.user.service.impl; + +import com.ifish7.mq.business.user.entity.TblUser; +import com.ifish7.mq.business.user.mapper.TblUserMapper; +import com.ifish7.mq.business.user.service.ITblUserService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author yan.y + * @since 2019-04-09 + */ +@Service +public class TblUserServiceImpl extends ServiceImpl implements ITblUserService { + +} diff --git a/src/main/java/com/ifish7/mq/queues/event/IntelligentHeatingRodEvent.java b/src/main/java/com/ifish7/mq/queues/event/IntelligentHeatingRodEvent.java new file mode 100644 index 0000000..03fe4cc --- /dev/null +++ b/src/main/java/com/ifish7/mq/queues/event/IntelligentHeatingRodEvent.java @@ -0,0 +1,52 @@ +package com.ifish7.mq.queues.event; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ifish7.mq.business.device.entity.TblDeviceHeater; +import com.ifish7.mq.business.device.service.ITblDeviceHeaterService; +import com.ifish7.mq.business.device.service.impl.TblDeviceHeaterServiceImpl; +import com.ifish7.mq.queues.event.support.EventSupport; +import com.ifish7.mq.utils.AppBeans; +import lombok.extern.log4j.Log4j; + +/** + * @author: yan.y + * @Description: 智能加热棒事件 + * @Date: Created in 22:13 2019/4/9 + */ +@Log4j +public class IntelligentHeatingRodEvent extends EventSupport { + + /** + * 智能加热棒新增或修改 + * @param eventBody + */ + public void intelligentHeatingRodSaveOrUpdate(String eventBody){ + log.info("eventBody : " + eventBody); + JSONObject json = JSON.parseObject(eventBody); + String entity = json.getString("entity"); + try { + TblDeviceHeater deviceHeater = (TblDeviceHeater) JSON.parseObject(json.getString("data"), Class.forName(entity)); + //获取service + ITblDeviceHeaterService deviceHeaterService = AppBeans.getBean(TblDeviceHeaterServiceImpl.class); + //查询 + TblDeviceHeater tblDeviceHeater = deviceHeaterService.getOne(new QueryWrapper().lambda() + .eq(TblDeviceHeater::getHeaterGatheringDate, deviceHeater.getHeaterGatheringDate()) + .eq(TblDeviceHeater::getHeaterGatheringTime, deviceHeater.getHeaterGatheringTime()) + .eq(TblDeviceHeater::getHeaterMacAddress, deviceHeater.getHeaterMacAddress())); + //更新 + if (tblDeviceHeater != null) { + tblDeviceHeater.setHeaterPh(deviceHeater.getHeaterPh()); + tblDeviceHeater.setHeaterWaterTemperature(deviceHeater.getHeaterWaterTemperature()); + deviceHeaterService.updateById(tblDeviceHeater); + } else { + //新增 + deviceHeaterService.save(deviceHeater); + } + } catch (ClassNotFoundException e) { + log.info(e.getMessage(),e); + } + } + +} diff --git a/src/main/java/com/ifish7/mq/queues/event/support/EventSupport.java b/src/main/java/com/ifish7/mq/queues/event/support/EventSupport.java new file mode 100644 index 0000000..4d9a07a --- /dev/null +++ b/src/main/java/com/ifish7/mq/queues/event/support/EventSupport.java @@ -0,0 +1,37 @@ +package com.ifish7.mq.queues.event.support; + +import lombok.Data; +import lombok.extern.log4j.Log4j; + +import java.lang.reflect.Method; + +/** + * @author: yan.y + * @Description: 事件总线处理 + * @Date: Created in 22:15 2019/4/9 + */ +@Log4j +@Data +public class EventSupport { + //事件处理类型 + protected String eventProcess; + + //事件名称 + protected String eventName; + + //事件体 + protected String eventBody; + + //事件处理 + public void process() { + try { + Class eventClazz = Class.forName(this.eventName); + Method method = eventClazz.getMethod(this.eventProcess, Class.forName("java.lang.String")); + method.setAccessible(true); + method.invoke(eventClazz.newInstance(),this.eventBody); + } catch (Exception e) { + log.info(e.getMessage(),e); + } + } + +} diff --git a/src/main/java/com/ifish7/mq/queues/listener/IfishDataQueueMessageListener.java b/src/main/java/com/ifish7/mq/queues/listener/IfishDataQueueMessageListener.java index a0e4c3c..b983199 100644 --- a/src/main/java/com/ifish7/mq/queues/listener/IfishDataQueueMessageListener.java +++ b/src/main/java/com/ifish7/mq/queues/listener/IfishDataQueueMessageListener.java @@ -1,5 +1,8 @@ package com.ifish7.mq.queues.listener; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; +import com.ifish7.mq.queues.event.support.EventSupport; import lombok.extern.log4j.Log4j; import javax.jms.JMSException; @@ -18,10 +21,11 @@ public class IfishDataQueueMessageListener implements MessageListener{ @Override public void onMessage(Message message) { - TextMessage tm = (TextMessage) message; try { log.info("Ifish7 - Data : " + tm.getText()); + EventSupport eventSupport = JSON.parseObject(tm.getText(), EventSupport.class); + eventSupport.process(); } catch (JMSException e) { log.error(e); } diff --git a/src/main/java/com/ifish7/mq/utils/AppBeans.java b/src/main/java/com/ifish7/mq/utils/AppBeans.java new file mode 100644 index 0000000..6fc9224 --- /dev/null +++ b/src/main/java/com/ifish7/mq/utils/AppBeans.java @@ -0,0 +1,28 @@ +package com.ifish7.mq.utils; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; + +/** + * @author: yan.y + * @Description: 获取spring管理的bean + * @Date: Created in 22:13 2019/4/9 + */ +public class AppBeans implements ApplicationContextAware { + + private static ApplicationContext app; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) + throws BeansException { + AppBeans.app = applicationContext; + } + + public static T getBean(Class clazz){ + if (app == null) + return null; + else + return app.getBean(clazz); + } +} diff --git a/src/main/java/com/ifish7/mq/utils/MybatisCodeGenerator.java b/src/main/java/com/ifish7/mq/utils/MybatisCodeGenerator.java new file mode 100644 index 0000000..fe0118c --- /dev/null +++ b/src/main/java/com/ifish7/mq/utils/MybatisCodeGenerator.java @@ -0,0 +1,126 @@ +package com.ifish7.mq.utils; + +import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.InjectionConfig; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; +import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; + +/** + * @author: yan.y + * @Description: mybatis代码生成 + * @Date: Created in 20:30 2019/4/9 + */ +public class MybatisCodeGenerator { + /** + *

+ * 读取控制台内容 + *

+ */ + public static String scanner(String tip) { + Scanner scanner = new Scanner(System.in); + StringBuilder help = new StringBuilder(); + help.append("请输入" + tip + ":"); + System.out.println(help.toString()); + if (scanner.hasNext()) { + String ipt = scanner.next(); + if (StringUtils.isNotEmpty(ipt)) { + return ipt; + } + } + throw new MybatisPlusException("请输入正确的" + tip + "!"); + } + + public static void main(String[] args) { + // 代码生成器 + AutoGenerator mpg = new AutoGenerator(); + + // 全局配置 + GlobalConfig gc = new GlobalConfig(); + String projectPath = System.getProperty("user.dir"); + gc.setOutputDir(projectPath + "/src/main/java"); + gc.setAuthor("yan.y"); + gc.setOpen(false); + // gc.setSwagger2(true); 实体属性 Swagger2 注解 + mpg.setGlobalConfig(gc); + + // 数据源配置 + DataSourceConfig dsc = new DataSourceConfig(); + dsc.setUrl("jdbc:mysql://localhost:3306/myfishdb?useUnicode=true&useSSL=false&characterEncoding=utf8"); + // dsc.setSchemaName("public"); + dsc.setDriverName("com.mysql.jdbc.Driver"); + dsc.setUsername("root"); + dsc.setPassword("123456"); + mpg.setDataSource(dsc); + + // 包配置 + PackageConfig pc = new PackageConfig(); + pc.setModuleName(scanner("模块名")); + pc.setParent("com.ifish7.mq.business"); + mpg.setPackageInfo(pc); + + // 自定义配置 + InjectionConfig cfg = new InjectionConfig() { + @Override + public void initMap() { + // to do nothing + } + }; + + // 如果模板引擎是 freemarker + String templatePath = "/templates/mapper.xml.ftl"; + // 如果模板引擎是 velocity + // String templatePath = "/templates/mapper.xml.vm"; + + // 自定义输出配置 + List focList = new ArrayList<>(); + // 自定义配置会被优先输出 + focList.add(new FileOutConfig(templatePath) { + @Override + public String outputFile(TableInfo tableInfo) { + // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!! + return projectPath + "/src/main/resources/mapper/" + pc.getModuleName() + + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML; + } + }); + + cfg.setFileOutConfigList(focList); + mpg.setCfg(cfg); + + // 配置模板 + TemplateConfig templateConfig = new TemplateConfig(); + + // 配置自定义输出模板 + //指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别 + // templateConfig.setEntity("templates/entity2.java"); + // templateConfig.setService(); + // templateConfig.setController(); + + templateConfig.setXml(null); + mpg.setTemplate(templateConfig); + + // 策略配置 + StrategyConfig strategy = new StrategyConfig(); + strategy.setNaming(NamingStrategy.underline_to_camel); + strategy.setColumnNaming(NamingStrategy.underline_to_camel); + strategy.setSuperEntityClass("com.baomidou.ant.common.BaseEntity"); + strategy.setEntityLombokModel(true); + strategy.setRestControllerStyle(true); + strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController"); + strategy.setInclude(scanner("表名,多个英文逗号分割").split(",")); + strategy.setSuperEntityColumns("id"); + strategy.setControllerMappingHyphenStyle(true); + strategy.setTablePrefix(pc.getModuleName() + "_"); + mpg.setStrategy(strategy); + mpg.setTemplateEngine(new FreemarkerTemplateEngine()); + mpg.execute(); + } +} diff --git a/src/main/java/com/ifish7/mq/utils/MybatisSqlSessionFactoryBean.java b/src/main/java/com/ifish7/mq/utils/MybatisSqlSessionFactoryBean.java new file mode 100644 index 0000000..7894b3f --- /dev/null +++ b/src/main/java/com/ifish7/mq/utils/MybatisSqlSessionFactoryBean.java @@ -0,0 +1,682 @@ +/* + * Copyright (c) 2011-2019, hubin (jobob@qq.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + *

+ * https://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.ifish7.mq.utils; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.core.MybatisConfiguration; +import com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBuilder; +import com.baomidou.mybatisplus.core.MybatisXMLConfigBuilder; +import com.baomidou.mybatisplus.core.config.GlobalConfig; +import com.baomidou.mybatisplus.core.enums.IEnum; +import com.baomidou.mybatisplus.core.toolkit.Assert; +import com.baomidou.mybatisplus.core.toolkit.ExceptionUtils; +import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils; +import com.baomidou.mybatisplus.core.toolkit.StringPool; +import com.baomidou.mybatisplus.extension.MybatisMapWrapperFactory; +import com.baomidou.mybatisplus.extension.handlers.EnumTypeHandler; +import com.baomidou.mybatisplus.extension.toolkit.AopUtils; +import com.baomidou.mybatisplus.extension.toolkit.JdbcUtils; +import com.baomidou.mybatisplus.extension.toolkit.PackageHelper; +import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import lombok.Setter; +import org.apache.ibatis.builder.xml.XMLMapperBuilder; +import org.apache.ibatis.cache.Cache; +import org.apache.ibatis.executor.ErrorContext; +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.io.VFS; +import org.apache.ibatis.mapping.DatabaseIdProvider; +import org.apache.ibatis.mapping.Environment; +import org.apache.ibatis.plugin.Interceptor; +import org.apache.ibatis.reflection.factory.ObjectFactory; +import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory; +import org.apache.ibatis.session.Configuration; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.session.SqlSessionFactoryBuilder; +import org.apache.ibatis.transaction.TransactionFactory; +import org.apache.ibatis.type.TypeHandler; +import org.apache.ibatis.type.TypeHandlerRegistry; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.transaction.SpringManagedTransactionFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.core.NestedIOException; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.core.io.support.ResourcePatternResolver; +import org.springframework.core.type.ClassMetadata; +import org.springframework.core.type.classreading.CachingMetadataReaderFactory; +import org.springframework.core.type.classreading.MetadataReaderFactory; +import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy; +import org.springframework.util.ClassUtils; + +import javax.sql.DataSource; +import java.io.IOException; +import java.lang.reflect.Modifier; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.HashSet; +import java.util.Optional; +import java.util.Properties; +import java.util.Set; +import java.util.stream.Stream; + +import static org.springframework.util.Assert.notNull; +import static org.springframework.util.Assert.state; +import static org.springframework.util.ObjectUtils.isEmpty; +import static org.springframework.util.StringUtils.hasLength; +import static org.springframework.util.StringUtils.tokenizeToStringArray; + +/** + * 拷贝类 {@link SqlSessionFactoryBean} 修改方法 buildSqlSessionFactory() 加载自定义 + *

MybatisXmlConfigBuilder

+ * + * @author hubin + * @since 2017-01-04 + */ +public class MybatisSqlSessionFactoryBean implements FactoryBean, InitializingBean, ApplicationListener { + + private static final Logger LOGGER = LoggerFactory.getLogger(MybatisSqlSessionFactoryBean.class); + + private static final ResourcePatternResolver RESOURCE_PATTERN_RESOLVER = new PathMatchingResourcePatternResolver(); + private static final MetadataReaderFactory METADATA_READER_FACTORY = new CachingMetadataReaderFactory(); + + private Resource configLocation; + + private MybatisConfiguration configuration; + + private Resource[] mapperLocations; + + private DataSource dataSource; + + private TransactionFactory transactionFactory; + + private Properties configurationProperties; + + private SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new MybatisSqlSessionFactoryBuilder(); + + private SqlSessionFactory sqlSessionFactory; + + //EnvironmentAware requires spring 3.1 + private String environment = MybatisSqlSessionFactoryBean.class.getSimpleName(); + + private boolean failFast; + + private Interceptor[] plugins; + + private TypeHandler[] typeHandlers; + + private String typeHandlersPackage; + + private Class[] typeAliases; + + private String typeAliasesPackage; + + private Class typeAliasesSuperType; + + //issue #19. No default provider. + private DatabaseIdProvider databaseIdProvider; + + private Class vfs; + + private Cache cache; + + private ObjectFactory objectFactory; + + private ObjectWrapperFactory objectWrapperFactory; + + // TODO 自定义枚举包 + @Setter + private String typeEnumsPackage; + + // TODO 自定义全局配置 + @Setter + private GlobalConfig globalConfig; + + /** + * Sets the ObjectFactory. + * + * @param objectFactory a custom ObjectFactory + * @since 1.1.2 + */ + public void setObjectFactory(ObjectFactory objectFactory) { + this.objectFactory = objectFactory; + } + + /** + * Sets the ObjectWrapperFactory. + * + * @param objectWrapperFactory a specified ObjectWrapperFactory + * @since 1.1.2 + */ + public void setObjectWrapperFactory(ObjectWrapperFactory objectWrapperFactory) { + this.objectWrapperFactory = objectWrapperFactory; + } + + /** + * Gets the DatabaseIdProvider + * + * @return a specified DatabaseIdProvider + * @since 1.1.0 + */ + public DatabaseIdProvider getDatabaseIdProvider() { + return databaseIdProvider; + } + + /** + * Sets the DatabaseIdProvider. + * As of version 1.2.2 this variable is not initialized by default. + * + * @param databaseIdProvider a DatabaseIdProvider + * @since 1.1.0 + */ + public void setDatabaseIdProvider(DatabaseIdProvider databaseIdProvider) { + this.databaseIdProvider = databaseIdProvider; + } + + /** + * Gets the VFS. + * + * @return a specified VFS + */ + public Class getVfs() { + return this.vfs; + } + + /** + * Sets the VFS. + * + * @param vfs a VFS + */ + public void setVfs(Class vfs) { + this.vfs = vfs; + } + + /** + * Gets the Cache. + * + * @return a specified Cache + */ + public Cache getCache() { + return this.cache; + } + + /** + * Sets the Cache. + * + * @param cache a Cache + */ + public void setCache(Cache cache) { + this.cache = cache; + } + + /** + * Mybatis plugin list. + * + * @param plugins list of plugins + * @since 1.0.1 + */ + public void setPlugins(Interceptor[] plugins) { + this.plugins = plugins; + } + + /** + * Packages to search for type aliases. + * + *

Since 2.0.1, allow to specify a wildcard such as {@code com.example.*.model}. + * + * @param typeAliasesPackage package to scan for domain objects + * @since 1.0.1 + */ + public void setTypeAliasesPackage(String typeAliasesPackage) { + this.typeAliasesPackage = typeAliasesPackage; + } + + /** + * Super class which domain objects have to extend to have a type alias created. + * No effect if there is no package to scan configured. + * + * @param typeAliasesSuperType super class for domain objects + * @since 1.1.2 + */ + public void setTypeAliasesSuperType(Class typeAliasesSuperType) { + this.typeAliasesSuperType = typeAliasesSuperType; + } + + /** + * Packages to search for type handlers. + * + *

Since 2.0.1, allow to specify a wildcard such as {@code com.example.*.typehandler}. + * + * @param typeHandlersPackage package to scan for type handlers + * @since 1.0.1 + */ + public void setTypeHandlersPackage(String typeHandlersPackage) { + this.typeHandlersPackage = typeHandlersPackage; + } + + /** + * Set type handlers. They must be annotated with {@code MappedTypes} and optionally with {@code MappedJdbcTypes} + * + * @param typeHandlers Type handler list + * @since 1.0.1 + */ + public void setTypeHandlers(TypeHandler[] typeHandlers) { + this.typeHandlers = typeHandlers; + } + + /** + * List of type aliases to register. They can be annotated with {@code Alias} + * + * @param typeAliases Type aliases list + * @since 1.0.1 + */ + public void setTypeAliases(Class[] typeAliases) { + this.typeAliases = typeAliases; + } + + /** + * If true, a final check is done on Configuration to assure that all mapped + * statements are fully loaded and there is no one still pending to resolve + * includes. Defaults to false. + * + * @param failFast enable failFast + * @since 1.0.1 + */ + public void setFailFast(boolean failFast) { + this.failFast = failFast; + } + + /** + * Set the location of the MyBatis {@code SqlSessionFactory} config file. A typical value is + * "WEB-INF/mybatis-configuration.xml". + * + * @param configLocation a location the MyBatis config file + */ + public void setConfigLocation(Resource configLocation) { + this.configLocation = configLocation; + } + + /** + * Set a customized MyBatis configuration. + * TODO 这里的入参使用 MybatisConfiguration 而不是 Configuration + * + * @param configuration MyBatis configuration + * @since 1.3.0 + */ + public void setConfiguration(MybatisConfiguration configuration) { + this.configuration = configuration; + } + + /** + * Set locations of MyBatis mapper files that are going to be merged into the {@code SqlSessionFactory} + * configuration at runtime. + *

+ * This is an alternative to specifying "<sqlmapper>" entries in an MyBatis config file. + * This property being based on Spring's resource abstraction also allows for specifying + * resource patterns here: e.g. "classpath*:sqlmap/*-mapper.xml". + * + * @param mapperLocations location of MyBatis mapper files + */ + public void setMapperLocations(Resource[] mapperLocations) { + this.mapperLocations = mapperLocations; + } + + /** + * Set optional properties to be passed into the SqlSession configuration, as alternative to a + * {@code <properties>} tag in the configuration xml file. This will be used to + * resolve placeholders in the config file. + * + * @param sqlSessionFactoryProperties optional properties for the SqlSessionFactory + */ + public void setConfigurationProperties(Properties sqlSessionFactoryProperties) { + this.configurationProperties = sqlSessionFactoryProperties; + } + + /** + * Set the JDBC {@code DataSource} that this instance should manage transactions for. The {@code DataSource} + * should match the one used by the {@code SqlSessionFactory}: for example, you could specify the same + * JNDI DataSource for both. + *

+ * A transactional JDBC {@code Connection} for this {@code DataSource} will be provided to application code + * accessing this {@code DataSource} directly via {@code DataSourceUtils} or {@code DataSourceTransactionManager}. + *

+ * The {@code DataSource} specified here should be the target {@code DataSource} to manage transactions for, not + * a {@code TransactionAwareDataSourceProxy}. Only data access code may work with + * {@code TransactionAwareDataSourceProxy}, while the transaction manager needs to work on the + * underlying target {@code DataSource}. If there's nevertheless a {@code TransactionAwareDataSourceProxy} + * passed in, it will be unwrapped to extract its target {@code DataSource}. + * + * @param dataSource a JDBC {@code DataSource} + */ + public void setDataSource(DataSource dataSource) { + if (dataSource instanceof TransactionAwareDataSourceProxy) { + // If we got a TransactionAwareDataSourceProxy, we need to perform + // transactions for its underlying target DataSource, else data + // access code won't see properly exposed transactions (i.e. + // transactions for the target DataSource). + this.dataSource = ((TransactionAwareDataSourceProxy) dataSource).getTargetDataSource(); + } else { + this.dataSource = dataSource; + } + } + + /** + * Sets the {@code SqlSessionFactoryBuilder} to use when creating the {@code SqlSessionFactory}. + *

+ * This is mainly meant for testing so that mock SqlSessionFactory classes can be injected. By + * default, {@code SqlSessionFactoryBuilder} creates {@code DefaultSqlSessionFactory} instances. + * + * @param sqlSessionFactoryBuilder a SqlSessionFactoryBuilder + */ + public void setSqlSessionFactoryBuilder(SqlSessionFactoryBuilder sqlSessionFactoryBuilder) { + this.sqlSessionFactoryBuilder = sqlSessionFactoryBuilder; + } + + /** + * Set the MyBatis TransactionFactory to use. Default is {@code SpringManagedTransactionFactory} + *

+ * The default {@code SpringManagedTransactionFactory} should be appropriate for all cases: + * be it Spring transaction management, EJB CMT or plain JTA. If there is no active transaction, + * SqlSession operations will execute SQL statements non-transactionally. + * + * It is strongly recommended to use the default {@code TransactionFactory}. If not used, any + * attempt at getting an SqlSession through Spring's MyBatis framework will throw an exception if + * a transaction is active. + * + * @param transactionFactory the MyBatis TransactionFactory + * @see SpringManagedTransactionFactory + */ + public void setTransactionFactory(TransactionFactory transactionFactory) { + this.transactionFactory = transactionFactory; + } + + /** + * NOTE: This class overrides any {@code Environment} you have set in the MyBatis + * config file. This is used only as a placeholder name. The default value is + * {@code SqlSessionFactoryBean.class.getSimpleName()}. + * + * @param environment the environment name + */ + public void setEnvironment(String environment) { + this.environment = environment; + } + + /** + * {@inheritDoc} + */ + @Override + public void afterPropertiesSet() throws Exception { + notNull(dataSource, "Property 'dataSource' is required"); + notNull(sqlSessionFactoryBuilder, "Property 'sqlSessionFactoryBuilder' is required"); + state((configuration == null && configLocation == null) || !(configuration != null && configLocation != null), + "Property 'configuration' and 'configLocation' can not specified with together"); + + this.sqlSessionFactory = buildSqlSessionFactory(); + } + + /** + * Build a {@code SqlSessionFactory} instance. + *

+ * The default implementation uses the standard MyBatis {@code XMLConfigBuilder} API to build a + * {@code SqlSessionFactory} instance based on an Reader. Since 1.3.0, it can be specified a + * {@link Configuration} instance directly(without config file). + *

+ * + * @return SqlSessionFactory + * @throws IOException if loading the config file failed + */ + protected SqlSessionFactory buildSqlSessionFactory() throws Exception { + + final MybatisConfiguration targetConfiguration; + + // TODO 使用 MybatisXmlConfigBuilder 而不是 XMLConfigBuilder + MybatisXMLConfigBuilder xmlConfigBuilder = null; + if (this.configuration != null) { + targetConfiguration = this.configuration; + if (targetConfiguration.getVariables() == null) { + targetConfiguration.setVariables(this.configurationProperties); + } else if (this.configurationProperties != null) { + targetConfiguration.getVariables().putAll(this.configurationProperties); + } + } else if (this.configLocation != null) { + // TODO 使用 MybatisXMLConfigBuilder + xmlConfigBuilder = new MybatisXMLConfigBuilder(this.configLocation.getInputStream(), null, this.configurationProperties); + targetConfiguration = xmlConfigBuilder.getConfiguration(); + } else { + LOGGER.debug("Property 'configuration' or 'configLocation' not specified, using default MyBatis Configuration"); + // TODO 使用 MybatisConfiguration + targetConfiguration = new MybatisConfiguration(); + Optional.ofNullable(this.configurationProperties).ifPresent(targetConfiguration::setVariables); + } + + // TODO 无配置启动所必须的 + this.globalConfig = Optional.ofNullable(this.globalConfig).orElseGet(GlobalConfigUtils::defaults); + this.globalConfig.setDbConfig(Optional.ofNullable(this.globalConfig.getDbConfig()).orElseGet(GlobalConfig.DbConfig::new)); + + // TODO 初始化 id-work 以及 打印骚东西 + targetConfiguration.init(this.globalConfig); + + // TODO 自动注入 map 接收返回结果下是否下划线转驼峰 + if (targetConfiguration.isMapUnderscoreToCamelCase()) { + targetConfiguration.setObjectWrapperFactory(new MybatisMapWrapperFactory()); + } + + // TODO 设置元数据相关 如果用户没有配置 dbType 则自动获取 + if (globalConfig.getDbConfig().getDbType() == DbType.OTHER) { + try (Connection connection = AopUtils.getTargetObject(this.dataSource).getConnection()) { + globalConfig.getDbConfig().setDbType(JdbcUtils.getDbType(connection.getMetaData().getURL())); + } catch (Exception e) { + throw ExceptionUtils.mpe("Error: GlobalConfigUtils setMetaData Fail ! Cause:" + e); + } + } + + // TODO 自定义枚举类扫描处理 + if (hasLength(this.typeEnumsPackage)) { + Set classes; + if (typeEnumsPackage.contains(StringPool.STAR) && !typeEnumsPackage.contains(StringPool.COMMA) + && !typeEnumsPackage.contains(StringPool.SEMICOLON)) { + classes = PackageHelper.scanTypePackage(typeEnumsPackage); + if (classes.isEmpty()) { + LOGGER.warn("Can't find class in '[" + typeEnumsPackage + "]' package. Please check your configuration."); + } + } else { + String[] typeEnumsPackageArray = tokenizeToStringArray(this.typeEnumsPackage, + ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS); + Assert.notNull(typeEnumsPackageArray, "not find typeEnumsPackage:" + typeEnumsPackage); + classes = new HashSet<>(); + Stream.of(typeEnumsPackageArray).forEach(typePackage -> { + Set scanTypePackage = PackageHelper.scanTypePackage(typePackage); + if (scanTypePackage.isEmpty()) { + LOGGER.warn("Can't find class in '[" + typePackage + "]' package. Please check your configuration."); + } else { + classes.addAll(PackageHelper.scanTypePackage(typePackage)); + } + }); + } + // 取得类型转换注册器 + TypeHandlerRegistry typeHandlerRegistry = targetConfiguration.getTypeHandlerRegistry(); + classes.stream() + .filter(Class::isEnum) + .filter(cls -> IEnum.class.isAssignableFrom(cls) || EnumTypeHandler.dealEnumType(cls).isPresent()) + .forEach(cls -> typeHandlerRegistry.register(cls, EnumTypeHandler.class)); + } + + Optional.ofNullable(this.objectFactory).ifPresent(targetConfiguration::setObjectFactory); + Optional.ofNullable(this.objectWrapperFactory).ifPresent(targetConfiguration::setObjectWrapperFactory); + Optional.ofNullable(this.vfs).ifPresent(targetConfiguration::setVfsImpl); + + if (hasLength(this.typeAliasesPackage)) { + scanClasses(this.typeAliasesPackage, this.typeAliasesSuperType) + .forEach(targetConfiguration.getTypeAliasRegistry()::registerAlias); + } + + if (!isEmpty(this.typeAliases)) { + Stream.of(this.typeAliases).forEach(typeAlias -> { + targetConfiguration.getTypeAliasRegistry().registerAlias(typeAlias); + LOGGER.debug("Registered type alias: '" + typeAlias + "'"); + }); + } + + if (!isEmpty(this.plugins)) { + Stream.of(this.plugins).forEach(plugin -> { + targetConfiguration.addInterceptor(plugin); + LOGGER.debug("Registered plugin: '" + plugin + "'"); + }); + } + + if (hasLength(this.typeHandlersPackage)) { + scanClasses(this.typeHandlersPackage, TypeHandler.class).stream() + .filter(clazz -> !clazz.isInterface()) + .filter(clazz -> !Modifier.isAbstract(clazz.getModifiers())) + .filter(clazz -> ClassUtils.getConstructorIfAvailable(clazz) != null) + .forEach(targetConfiguration.getTypeHandlerRegistry()::register); + } + + if (!isEmpty(this.typeHandlers)) { + Stream.of(this.typeHandlers).forEach(typeHandler -> { + targetConfiguration.getTypeHandlerRegistry().register(typeHandler); + LOGGER.debug("Registered type handler: '" + typeHandler + "'"); + }); + } + + if (this.databaseIdProvider != null) {//fix #64 set databaseId before parse mapper xmls + try { + targetConfiguration.setDatabaseId(this.databaseIdProvider.getDatabaseId(this.dataSource)); + } catch (SQLException e) { + throw new NestedIOException("Failed getting a databaseId", e); + } + } + + Optional.ofNullable(this.cache).ifPresent(targetConfiguration::addCache); + + if (xmlConfigBuilder != null) { + try { + xmlConfigBuilder.parse(); + LOGGER.debug("Parsed configuration file: '" + this.configLocation + "'"); + } catch (Exception ex) { + throw new NestedIOException("Failed to parse config resource: " + this.configLocation, ex); + } finally { + ErrorContext.instance().reset(); + } + } + + targetConfiguration.setEnvironment(new Environment(this.environment, + this.transactionFactory == null ? new SpringManagedTransactionFactory() : this.transactionFactory, + this.dataSource)); + + if (this.mapperLocations != null) { + if (this.mapperLocations.length == 0) { + LOGGER.warn("Property 'mapperLocations' was specified but matching resources are not found."); + } else { + for (Resource mapperLocation : this.mapperLocations) { + if (mapperLocation == null) { + continue; + } + try { + XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(mapperLocation.getInputStream(), + targetConfiguration, mapperLocation.toString(), targetConfiguration.getSqlFragments()); + xmlMapperBuilder.parse(); + } catch (Exception e) { + throw new NestedIOException("Failed to parse mapping resource: '" + mapperLocation + "'", e); + } finally { + ErrorContext.instance().reset(); + } + LOGGER.debug("Parsed mapper file: '" + mapperLocation + "'"); + } + } + } else { + LOGGER.debug("Property 'mapperLocations' was not specified."); + } + + SqlSessionFactory sqlSessionFactory = this.sqlSessionFactoryBuilder.build(targetConfiguration); + + // TODO SqlRunner + SqlHelper.FACTORY = sqlSessionFactory; + + // TODO 设置全局参数属性 以及 缓存 sqlSessionFactory + globalConfig.signGlobalConfig(sqlSessionFactory); + + return sqlSessionFactory; + } + + /** + * {@inheritDoc} + */ + @Override + public SqlSessionFactory getObject() throws Exception { + if (this.sqlSessionFactory == null) { + afterPropertiesSet(); + } + + return this.sqlSessionFactory; + } + + /** + * {@inheritDoc} + */ + @Override + public Class getObjectType() { + return this.sqlSessionFactory == null ? SqlSessionFactory.class : this.sqlSessionFactory.getClass(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isSingleton() { + return true; + } + + /** + * {@inheritDoc} + */ + @Override + public void onApplicationEvent(ApplicationEvent event) { + if (failFast && event instanceof ContextRefreshedEvent) { + // fail-fast -> check all statements are completed + this.sqlSessionFactory.getConfiguration().getMappedStatementNames(); + } + } + + private Set> scanClasses(String packagePatterns, Class assignableType) + throws IOException { + Set> classes = new HashSet<>(); + String[] packagePatternArray = tokenizeToStringArray(packagePatterns, + ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS); + for (String packagePattern : packagePatternArray) { + Resource[] resources = RESOURCE_PATTERN_RESOLVER.getResources(ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + + org.springframework.util.ClassUtils.convertClassNameToResourcePath(packagePattern) + "/**/*.class"); + for (Resource resource : resources) { + try { + ClassMetadata classMetadata = METADATA_READER_FACTORY.getMetadataReader(resource).getClassMetadata(); + Class clazz = Resources.classForName(classMetadata.getClassName()); + if (assignableType == null || assignableType.isAssignableFrom(clazz)) { + classes.add(clazz); + } + } catch (Throwable e) { + LOGGER.warn("Cannot load the '" + resource + "'. Cause by " + e.toString()); + } + } + } + return classes; + } +} \ No newline at end of file diff --git a/src/main/resources/jdbc.properties b/src/main/resources/jdbc.properties index a5700c3..8362d6d 100644 --- a/src/main/resources/jdbc.properties +++ b/src/main/resources/jdbc.properties @@ -1,8 +1,10 @@ jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc\:mysql\://localhost\:3306/myfishdb?characterEncoding\=UTF-8 #jdbc.url=jdbc\:mysql\://139.196.24.156\:3306/myfishdb?characterEncoding\=UTF-8 -jdbc.username=ifish -jdbc.password=ifish7pwd +jdbc.username=root +jdbc.password=123456 +#jdbc.username=ifish +#jdbc.password=ifish7pwd #jdbc.username=root #jdbc.password=ifish7mysql #jdbc.testWhileIdle=true diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties index 3c68054..953e587 100644 --- a/src/main/resources/log4j.properties +++ b/src/main/resources/log4j.properties @@ -1,4 +1,4 @@ -log4j.rootLogger=INFO,Console,File +log4j.rootLogger=DEBUG,Console,File #\u5B9A\u4E49\u65E5\u5FD7\u8F93\u51FA\u76EE\u7684\u5730\u4E3A\u63A7\u5236\u53F0 log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.Target=System.out diff --git a/src/main/resources/mapper/device/TblDeviceHeaterMapper.xml b/src/main/resources/mapper/device/TblDeviceHeaterMapper.xml new file mode 100644 index 0000000..78f52d3 --- /dev/null +++ b/src/main/resources/mapper/device/TblDeviceHeaterMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/device/TblDeviceMapper.xml b/src/main/resources/mapper/device/TblDeviceMapper.xml new file mode 100644 index 0000000..61d89c0 --- /dev/null +++ b/src/main/resources/mapper/device/TblDeviceMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/device/TblFactoryHardwareMapper.xml b/src/main/resources/mapper/device/TblFactoryHardwareMapper.xml new file mode 100644 index 0000000..770405a --- /dev/null +++ b/src/main/resources/mapper/device/TblFactoryHardwareMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/device/TblFactoryListMapper.xml b/src/main/resources/mapper/device/TblFactoryListMapper.xml new file mode 100644 index 0000000..4f1eb5e --- /dev/null +++ b/src/main/resources/mapper/device/TblFactoryListMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/device/TblHardwareTypeMapper.xml b/src/main/resources/mapper/device/TblHardwareTypeMapper.xml new file mode 100644 index 0000000..f90b3da --- /dev/null +++ b/src/main/resources/mapper/device/TblHardwareTypeMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/user/TblDeviceUserMapper.xml b/src/main/resources/mapper/user/TblDeviceUserMapper.xml new file mode 100644 index 0000000..b90a17d --- /dev/null +++ b/src/main/resources/mapper/user/TblDeviceUserMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/user/TblLoginRecordMapper.xml b/src/main/resources/mapper/user/TblLoginRecordMapper.xml new file mode 100644 index 0000000..d91a320 --- /dev/null +++ b/src/main/resources/mapper/user/TblLoginRecordMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/user/TblPushListMapper.xml b/src/main/resources/mapper/user/TblPushListMapper.xml new file mode 100644 index 0000000..a958fe3 --- /dev/null +++ b/src/main/resources/mapper/user/TblPushListMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/user/TblUserMapper.xml b/src/main/resources/mapper/user/TblUserMapper.xml new file mode 100644 index 0000000..2cd530c --- /dev/null +++ b/src/main/resources/mapper/user/TblUserMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/spring-main.xml b/src/main/resources/spring-main.xml new file mode 100644 index 0000000..676646a --- /dev/null +++ b/src/main/resources/spring-main.xml @@ -0,0 +1,26 @@ + + + + + + + classpath:mq.properties + classpath:jdbc.properties + classpath:log4j.properties + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/spring-mq.xml b/src/main/resources/spring/spring-mq.xml similarity index 85% rename from src/main/resources/spring-mq.xml rename to src/main/resources/spring/spring-mq.xml index 2868adb..132f816 100644 --- a/src/main/resources/spring-mq.xml +++ b/src/main/resources/spring/spring-mq.xml @@ -1,21 +1,12 @@ - - - - - - - - - - - - - - + @@ -59,15 +47,15 @@ - + - - - + + + - + @@ -86,7 +74,7 @@ - + @@ -95,9 +83,15 @@ + + + + + - + + \ No newline at end of file