style:()删除无用的测试类
parent
a63bde6c84
commit
b9c4334cb5
|
@ -1,6 +1,6 @@
|
||||||
package com.muyu.auth.service;
|
package com.muyu.auth.service;
|
||||||
|
|
||||||
import com.muyu.auth.form.EnterpriseSettlement;
|
|
||||||
import com.muyu.common.core.constant.CacheConstants;
|
import com.muyu.common.core.constant.CacheConstants;
|
||||||
import com.muyu.common.core.constant.Constants;
|
import com.muyu.common.core.constant.Constants;
|
||||||
import com.muyu.common.core.constant.SecurityConstants;
|
import com.muyu.common.core.constant.SecurityConstants;
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
package com.muyu.cloud.common.many.datasource;
|
|
||||||
|
|
||||||
import com.muyu.cloud.common.many.datasource.constents.DatasourceContent;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.sql.Statement;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试添加数据源
|
|
||||||
* @author 袁子龙
|
|
||||||
* @package com.muyu.cloud.common.many.datasource
|
|
||||||
* @name JDBCDemo
|
|
||||||
* @date 2024/9/30 18:14
|
|
||||||
*/
|
|
||||||
@Log4j2
|
|
||||||
public class JDBCDemo {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
String databaseName = "my_database";
|
|
||||||
|
|
||||||
String connectUrl = DatasourceContent.getDatasourceUrl("mysql");
|
|
||||||
|
|
||||||
String createDatabaseUrl = "jdbc:mysql://" + DatasourceContent.IP + ":" + DatasourceContent.PORT + "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
|
|
||||||
String createDatabaseSql = "CREATE DATABASE IF NOT EXISTS " + databaseName + ";";
|
|
||||||
|
|
||||||
try (Connection adminConn = DriverManager.getConnection(createDatabaseUrl, DatasourceContent.USER_NAME, DatasourceContent.PASSWORD);
|
|
||||||
Statement stmt = adminConn.createStatement()) {
|
|
||||||
|
|
||||||
boolean success = stmt.execute(createDatabaseSql);
|
|
||||||
if (success) {
|
|
||||||
log.info("数据库 {} 创建成功", databaseName);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
log.warn("数据库 {} 创建失败,可能已存在或权限不足", databaseName);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
log.error("连接数据库时发生错误或创建数据库失败", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -29,7 +29,8 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: DongZeLiang
|
* 多数据源
|
||||||
|
* @author liuwu
|
||||||
* @date: 2024/6/3
|
* @date: 2024/6/3
|
||||||
* @Description: 多数据源
|
* @Description: 多数据源
|
||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package com.muyu.cloud.common.many.datasource.constents;
|
package com.muyu.cloud.common.many.datasource.constents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* 数据源常量
|
||||||
|
* @author liuwu
|
||||||
* @description: 数据源常量
|
* @description: 数据源常量
|
||||||
* @Date 2023-8-1 上午 11:02
|
* @Date 2023-8-1 上午 11:02
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -8,7 +8,8 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* 数据源实体类
|
||||||
|
* @author liuwu
|
||||||
* @description: 数据源实体类
|
* @description: 数据源实体类
|
||||||
* @Date 2023-8-1 上午 11:15
|
* @Date 2023-8-1 上午 11:15
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -8,7 +8,8 @@ import org.springframework.stereotype.Component;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: DongZeLiang
|
* Druid工厂
|
||||||
|
* @author liuwu
|
||||||
* @date: 2024/6/3
|
* @date: 2024/6/3
|
||||||
* @Description: Druid工厂
|
* @Description: Druid工厂
|
||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
|
|
|
@ -6,7 +6,7 @@ import org.springframework.util.Assert;
|
||||||
/**
|
/**
|
||||||
* 数据源切换处理
|
* 数据源切换处理
|
||||||
*
|
*
|
||||||
* @author Dongzl
|
* @author liuwu
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class DynamicDataSourceHolder {
|
public class DynamicDataSourceHolder {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package com.muyu.cloud.common.saas.contents;
|
package com.muyu.cloud.common.saas.contents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: DongZeLiang
|
* SAAS常量
|
||||||
|
* @author liuwu
|
||||||
* @date: 2024/6/3
|
* @date: 2024/6/3
|
||||||
* @Description: SAAS常量
|
* @Description: SAAS常量
|
||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
|
|
|
@ -6,7 +6,7 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: DongZeLiang
|
* @Author: liuwu
|
||||||
* @date: 2024/6/3
|
* @date: 2024/6/3
|
||||||
* @Description: 企业信息
|
* @Description: 企业信息
|
||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
|
|
|
@ -4,7 +4,8 @@ package com.muyu.cloud.common.saas.exception;
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: DongZeLiang
|
* SaaS异常类
|
||||||
|
* @author liuwu
|
||||||
* @date: 2024/6/3
|
* @date: 2024/6/3
|
||||||
* @Description: SaaS异常类
|
* @Description: SaaS异常类
|
||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
|
|
|
@ -14,7 +14,8 @@ import org.springframework.web.servlet.AsyncHandlerInterceptor;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: DongZeLiang
|
* SAAS拦截器
|
||||||
|
* @author liuwu
|
||||||
* @date: 2024/6/3
|
* @date: 2024/6/3
|
||||||
* @Description: SAAS拦截器
|
* @Description: SAAS拦截器
|
||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
|
|
|
@ -9,14 +9,14 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息 Mapper接口
|
* 企业信息Mapper接口
|
||||||
* @author yupnig
|
* @author yupnig
|
||||||
* @package com.muyu.server.mapper
|
* @package com.muyu.server.mapper
|
||||||
* @name EnterpriseDao
|
* @name EnterpriseMapper
|
||||||
* @date 2024-09-29 14:31:06
|
* @date 2024-09-29 14:31:06
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface EnterpriseDao {
|
public interface EnterpriseMapper {
|
||||||
// 查询分页信息
|
// 查询分页信息
|
||||||
public ArrayList<HashMap> selectEnterprise(Map param);
|
public ArrayList<HashMap> selectEnterprise(Map param);
|
||||||
//查询企业记录总数
|
//查询企业记录总数
|
|
@ -4,7 +4,7 @@ import cn.hutool.core.map.MapUtil;
|
||||||
import com.muyu.cache.EnterpriseCacheService;
|
import com.muyu.cache.EnterpriseCacheService;
|
||||||
import com.muyu.common.domain.Enterprise;
|
import com.muyu.common.domain.Enterprise;
|
||||||
import com.muyu.common.util.PageUtils;
|
import com.muyu.common.util.PageUtils;
|
||||||
import com.muyu.server.mapper.EnterpriseDao;
|
import com.muyu.server.mapper.EnterpriseMapper;
|
||||||
import com.muyu.server.service.EnterpriseService;
|
import com.muyu.server.service.EnterpriseService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -22,7 +22,7 @@ import java.util.*;
|
||||||
public class EnterpriseServiceImpl implements EnterpriseService {
|
public class EnterpriseServiceImpl implements EnterpriseService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EnterpriseDao enterpriseDao;
|
private EnterpriseMapper enterpriseDao;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EnterpriseCacheService enterpriseCacheService;
|
private EnterpriseCacheService enterpriseCacheService;
|
||||||
|
|
|
@ -13,9 +13,16 @@ import com.muyu.server.service.SysCarService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理 服务层处理
|
||||||
|
* @author sx
|
||||||
|
* @package com.muyu.server.service.impl
|
||||||
|
* @name SysCarServiceImpl
|
||||||
|
* @date 2024-09-29 14:31:06
|
||||||
|
*/
|
||||||
@DS("lizzDB")
|
@DS("lizzDB")
|
||||||
@Service
|
@Service
|
||||||
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> implements SysCarService {
|
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> implements SysCarService {
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.server.service.impl;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.cache.SysCarCacheService;
|
|
||||||
import com.muyu.common.domain.MessageTemplateType;
|
import com.muyu.common.domain.MessageTemplateType;
|
||||||
import com.muyu.common.domain.SysCar;
|
import com.muyu.common.domain.SysCar;
|
||||||
import com.muyu.common.domain.Template;
|
import com.muyu.common.domain.Template;
|
||||||
|
@ -21,7 +20,8 @@ import java.sql.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
/**
|
/**
|
||||||
* @Author:liuxinyue
|
* 报文模版 服务层处理
|
||||||
|
* @author liuxinyue
|
||||||
* @Package:com.template.service.impl
|
* @Package:com.template.service.impl
|
||||||
* @Project:cloud-server-c
|
* @Project:cloud-server-c
|
||||||
* @name:TemplateServiceImp
|
* @name:TemplateServiceImp
|
||||||
|
@ -31,8 +31,7 @@ import java.util.concurrent.ExecutionException;
|
||||||
@Service
|
@Service
|
||||||
public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> implements TemplateService {
|
public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> implements TemplateService {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private static TemplateMapper templateMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysCarService sysCarService;
|
private SysCarService sysCarService;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
1.在mybats的开发中namespace有特殊的意思,一定要是对应接口的全限定名
|
1.在mybats的开发中namespace有特殊的意思,一定要是对应接口的全限定名
|
||||||
通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)
|
通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)
|
||||||
-->
|
-->
|
||||||
<mapper namespace="com.muyu.server.mapper.EnterpriseDao">
|
<mapper namespace="com.muyu.server.mapper.EnterpriseMapper">
|
||||||
|
|
||||||
<!--查询企业信息-->
|
<!--查询企业信息-->
|
||||||
<select id="selectEnterprise" resultType="HashMap" parameterType="Map">
|
<select id="selectEnterprise" resultType="HashMap" parameterType="Map">
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--新增企业信息-->
|
<!--新增企业信息-->
|
||||||
<insert id="insert" parameterType="com.muyu.server.mapper.EnterpriseDao">
|
<insert id="insert" parameterType="com.muyu.server.mapper.EnterpriseMapper">
|
||||||
insert into tb_enterprise
|
insert into tb_enterprise
|
||||||
set enterprise_name = #{enterpriseName},
|
set enterprise_name = #{enterpriseName},
|
||||||
enterprise_car_count = #{enterpriseCarCount},
|
enterprise_car_count = #{enterpriseCarCount},
|
||||||
|
|
Loading…
Reference in New Issue