tao.mo

common-dao、common-dependencies、kafka-cndc-server、manager-server、biz-customer | 修改 | 国际化配置以及表结构调整

mt
2024年11月7日20:05:55
Showing 39 changed files with 824 additions and 70 deletions
package com.fedex.connect.customer.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
/**
* SwaggerConfig配置类.开启Swagger2,自动生成文档
*
* @author EDY
*/
@Configuration
@EnableSwagger2
@Profile({"dev", "test", "uat"})
public class SwaggerConfig {
/**
* 扫描Controller包的路径
*/
public static final String BASE_PACKAGE = "com.fedex.connect.customer.controller";
/**
* API信息
*/
public static final String API_INFO = "iClear Connect-Pre-Clearance Biz-customer APIs";
public static final String API_VERSION = "1.0";
/**
* 创建API应用
*
* @return
*/
@Bean
public Docket restApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo(API_INFO, API_VERSION))
.useDefaultResponseMessages(true)
.forCodeGeneration(false)
.select()
// 扫描指定目录的API
.apis(RequestHandlerSelectors.basePackage(BASE_PACKAGE))
.paths(PathSelectors.any())
.build()
//配置全局io.swagger.model
.securitySchemes(securitySchemes())
//配置将安全上下文应用于哪些api操作(通过正则表达式模式)和HTTP方法
.securityContexts(securityContexts());
}
/**
* API的基本信息
*
* @return
*/
private ApiInfo apiInfo(String title, String version) {
return new ApiInfoBuilder().title(title).description(API_INFO).version(version).build();
}
private List<ApiKey> securitySchemes() {
List<ApiKey> apiKeys = new ArrayList<>();
/*SecurityConstants.TOKEN_HEADER*/
apiKeys.add(new ApiKey("Authorization", "Authorization", "header"));
return apiKeys;
}
private List<SecurityContext> securityContexts() {
List<SecurityContext> securityContexts = new ArrayList<>();
securityContexts.add(SecurityContext.builder()
.securityReferences(defaultAuth())
//指定/auth 请求下不会携带全局参数
.forPaths(PathSelectors.regex("^(?!/auth).*$")).build());
return securityContexts;
}
private List<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
List<SecurityReference> securityReferences = new ArrayList<>();
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
return securityReferences;
}
}
......@@ -4,12 +4,14 @@ import com.fedex.connect.common.dependencies.date.model.LogShowModel;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.dependencies.enums.BaseResponseCode;
import com.fedex.connect.common.dependencies.util.CurrentUserInfo;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.controller.base.BaseController;
import com.fedex.connect.customer.controller.biz.IAttachmentQueryController;
import com.fedex.connect.customer.data.bo.LongBo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -34,15 +36,25 @@ public class AttachmentQueryController extends BaseController implements IAttach
if (responseResultVo != null){
return responseResultVo;
}
Long userId = null;
try {
userId = CurrentUserInfo.getUserId();
//userId = 0L;
} catch (Exception e) {
log.error(LogShowModel.showException("Exception", e));
return ResponseVo.fail(localeMessageUtil.getMessage(BaseResponseCode.TOKEN_FORMAT_ERROR.getMsg()));
}
return attachmentQueryService.findHistory(userId,bo.getId());
/**
* 获取当前用户信息
*/
User user = this.getCurrentUserInfo();
return attachmentQueryService.findHistory(user.getId(),bo.getId());
}
// @PostMapping("/history")
// @ApiOperation(value = "历史上传记录查询")
// @Override
// public ResponseVo findHistory(@RequestBody LongBo bo) {
// ResponseVo responseResultVo = attachmentValidate.preCheckForFindHistory(bo);
// if (responseResultVo != null){
// return responseResultVo;
// }
// /**
// * 获取当前用户信息
// */
// User user = this.getCurrentUserInfo();
// return attachmentQueryService.findHistory(user.getId(),bo.getId());
// }
}
......
......@@ -35,7 +35,10 @@ public class ConsignmentController extends BaseController implements IConsignmen
if (responseResultVo != null){
return responseResultVo;
}
User user = getUserInfo(localeMessageUtil);
/**
* 获取当前用户信息
*/
User user = this.getCurrentUserInfo();
return consignmentService.add(bo,user);
}
}
......
......@@ -42,17 +42,20 @@ public class ConsignmentQueryController extends BaseController implements IConsi
@Override
public ResponseVo findConsignmentInfo(@ApiParam(value="运单ID",required = true) @PathVariable(value = "id") Long id) {
/**
* 运单id校验
*/
consignmentInfoValidate.validateConsignmentId(id);
/**
* 获取当前用户信息
*/
User user = this.getCurrentUserInfo();
ConsignmentInfoQuery consignmentInfoQuery = new ConsignmentInfoQuery();
consignmentInfoQuery.setUserId(user.getId());
consignmentInfoQuery.setUserUuid(user.getUserUuid());
consignmentInfoQuery.setConsignmentId(id);
/**
* 运单id校验
* 运单信息查询
*/
consignmentInfoValidate.validateConsignmentId(id);
ConsignmentInfoQuery detailQuery = new ConsignmentInfoQuery();
detailQuery.setUserId(user.getId());
detailQuery.setUuid(user.getUserUuid());
detailQuery.setConsignmentId(id);
return consignmentQueryService.findConsignmentInfo(detailQuery);
return consignmentQueryService.findConsignmentInfo(consignmentInfoQuery);
}
}
......
......@@ -12,7 +12,7 @@ public class ConsignmentInfoQuery {
//用户id
private Long userId;
//用户uuid
private String uuid;
private String userUuid;
//运单id
private Long consignmentId;
}
......
......@@ -2,6 +2,7 @@ package com.fedex.connect.customer.repository.dao;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
import com.fedex.connect.customer.data.query.ConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -22,4 +23,8 @@ public interface ConsignmentExtMapper {
"ORDER BY CREATE_TIME DESC" +
") WHERE ROWNUM = 1")
Consignment findByConsignmentCode(@Param("consignmentCode") String consignmentCode);
@Select("SELECT BC.* FROM T_BIZ_CONSIGNMENT BC INNER JOIN T_BIZ_USER_CONSIGNMENT_MAPPING BUCM ON(BC.ID = BUCM.CONSIGNMENT_ID) " +
"WHERE BC.ID = #{query.consignmentId} AND (BC.USER_UUID = #{query.userUuid} AND BUCM.USER_ID = #{query.userId})")
Consignment findConsignmentInfo(@Param("query") ConsignmentInfoQuery query);
}
......
......@@ -2,6 +2,7 @@ package com.fedex.connect.customer.repository.repo;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
import com.fedex.connect.customer.data.query.ConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
import java.util.List;
......@@ -12,4 +13,6 @@ public interface IConsignmentExtRepository {
Long findAllCount(ConsignmentQuery query);
Consignment findByConsignmentCode(String consignmentCode);
Consignment findConsignmentInfo(ConsignmentInfoQuery consignmentInfoQuery);
}
......
......@@ -2,6 +2,7 @@ package com.fedex.connect.customer.repository.repo.impl;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
import com.fedex.connect.customer.data.query.ConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
import com.fedex.connect.customer.repository.base.BaseDao;
import com.fedex.connect.customer.repository.repo.IConsignmentExtRepository;
......@@ -26,4 +27,8 @@ public class ConsignmentExtRepositoryImpl extends BaseDao implements IConsignmen
public Consignment findByConsignmentCode(String consignmentCode) {
return consignmentExtMapper.findByConsignmentCode(consignmentCode);
}
public Consignment findConsignmentInfo(ConsignmentInfoQuery consignmentInfoQuery){
return consignmentExtMapper.findConsignmentInfo(consignmentInfoQuery);
}
}
......
......@@ -14,5 +14,12 @@ public interface IConsignmentQueryService {
*/
ResponseVo findConsignments(ConsignmentQuery query);
ResponseVo findConsignmentInfo(ConsignmentInfoQuery detailQuery);
/**
* @Author mt
* @Description 运单信息查询
* @Date 2024/11/7
* @param consignmentInfoQuery
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
ResponseVo findConsignmentInfo(ConsignmentInfoQuery consignmentInfoQuery);
}
......
......@@ -4,6 +4,7 @@ import com.fedex.connect.common.dependencies.contants.GlobalConstantFedex;
import com.fedex.connect.common.dependencies.date.vo.PageResult;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
import com.fedex.connect.customer.data.query.ConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
......@@ -12,6 +13,7 @@ import com.fedex.connect.customer.service.biz.IConsignmentQueryService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @Author Szl
......@@ -47,7 +49,26 @@ public class ConsignmentQueryServiceImpl extends BaseService implements IConsign
return ResponseVo.succ(pageResult);
}
public ResponseVo findConsignmentInfo(ConsignmentInfoQuery detailQuery){
return null;
/**
* @Author mt
* @Description 运单信息查询
* 如果运单UUID与登录账号UUID相同,则显示运单、收发件人信息
* 如果运单UUID与登录账号UUID不同,则只显示 运单号、shipperAccount、始发国、目的国
* @Date 2024/11/7
* @param consignmentInfoQuery
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public ResponseVo findConsignmentInfo(ConsignmentInfoQuery consignmentInfoQuery){
Consignment consignment = consignmentExtRepository.findConsignmentInfo(consignmentInfoQuery);
if(Objects.nonNull(consignment) && !consignment.getUserUuid().equals(consignmentInfoQuery.getUserUuid())){
Consignment consignmentTemp = new Consignment();
consignmentTemp.setId(consignment.getId());
consignmentTemp.setConsignmentCode(consignment.getConsignmentCode());
consignmentTemp.setShipperAccount(consignment.getShipperAccount());
consignmentTemp.setOriginCountry(consignment.getOriginCountry());
consignmentTemp.setDestinationCountry(consignment.getDestinationCountry());
consignment = consignmentTemp;
}
return ResponseVo.succ(consignment);
}
}
......
......@@ -20,6 +20,23 @@ spring:
basename: message
encoding: utf-8
import:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /biz-customer/auth
- /biz-customer/monitor/ok
- /biz-customer/user/logout
- /biz-customer/swagger-resources
- /biz-customer/webjars
uriWhiteList:
- /biz-customer/swagger-ui.html
- /biz-customer/swagger-ui/*
- /biz-customer/v2/api-docs
- /biz-customer/login.html
expire_1H: 7200
expire_1D: 604800
mybatis:
mapper-locations:
- classpath*:com/fedex/connect/**/mapper/**/*.xml
......
conl_cus_declare_count_max=單次最多可查詢1000個運單號碼
conl_cus_declare_count_max=單次最多可查詢1000個運單號碼
#authentication
auth_exc_no_auth=沒有訪問許可權
auth_exc_no_pass_auth=沒有通過許可權認證
auth_filter_user_error=登錄身份異常
auth_filter_timeout=登錄超過8小時,請重新登錄
auth_filter_stale_dated=登錄已過期
#authentication
auth_exc_no_auth=沒有訪問許可權
auth_exc_no_pass_auth=沒有通過許可權認證
auth_filter_user_error=登錄身份異常
auth_filter_timeout=登錄超過8小時,請重新登錄
auth_filter_stale_dated=登錄已過期
enum_res_code_301=登錄身份異常
enum_res_code_305=登錄已過期,請重新登錄
enum_res_code_301=登錄身份異常
enum_res_code_305=登錄已過期,請重新登錄
enum_res_code_601=不正确,请重新输入
enum_res_code_601=不正确,请重新输入
enum_res_code_602=The waybill you entered is generated by another user, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
enum_res_code_603=The waybill you entered is generated by another account, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
con_shipperAccount=发货人计费账号
con_shipperCountry=始发国
con_recipientCountry=目的国
con_shipperAccount=发货人计费账号
con_shipperCountry=始发国
con_recipientCountry=目的国
con_add_oper=添加运单
\ No newline at end of file
con_add_oper=添加运单
\ No newline at end of file
......
conl_cus_declare_count_max=單次最多可查詢1000個運單號碼
conl_cus_declare_count_max=單次最多可查詢1000個運單號碼
enum_res_code_301=登錄身份異常
enum_res_code_305=登錄已過期,請重新登錄
#authentication包
auth_exc_no_auth=沒有訪問許可權
auth_exc_no_pass_auth=沒有通過許可權認證
auth_filter_user_error=登錄身份異常
auth_filter_timeout=登錄超過8小時,請重新登錄
auth_filter_stale_dated=登錄已過期
enum_res_code_601=不正确,请重新输入
enum_res_code_301=登錄身份異常
enum_res_code_305=登錄已過期,請重新登錄
enum_res_code_601=不正确,请重新输入
enum_res_code_602=The waybill you entered is generated by another user, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
enum_res_code_603=The waybill you entered is generated by another account, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
con_shipperAccount=发货人计费账号
con_shipperCountry=始发国
con_recipientCountry=目的国
con_shipperAccount=发货人计费账号
con_shipperCountry=始发国
con_recipientCountry=目的国
con_add_oper=添加运单
\ No newline at end of file
con_add_oper=添加运单
\ No newline at end of file
......
......@@ -2,9 +2,8 @@ package com.fedex.connect.common.dao.biz;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.ConsignmentExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ConsignmentMapper {
long countByExample(ConsignmentExample example);
......
package com.fedex.connect.common.dao.biz;
import com.fedex.connect.common.model.biz.UploadRecord;
import com.fedex.connect.common.model.biz.UploadRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UploadRecordMapper {
long countByExample(UploadRecordExample example);
int deleteByExample(UploadRecordExample example);
int deleteByPrimaryKey(Long id);
int insert(UploadRecord record);
int insertSelective(UploadRecord record);
List<UploadRecord> selectByExample(UploadRecordExample example);
UploadRecord selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") UploadRecord record, @Param("example") UploadRecordExample example);
int updateByExample(@Param("record") UploadRecord record, @Param("example") UploadRecordExample example);
int updateByPrimaryKeySelective(UploadRecord record);
int updateByPrimaryKey(UploadRecord record);
}
\ No newline at end of file
......@@ -18,6 +18,7 @@
<result column="MODIFY_TIME" jdbcType="TIMESTAMP" property="modifyTime" />
<result column="MODIFY_USER_ID" jdbcType="NUMERIC" property="modifyUserId" />
<result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" />
<result column="UPLOAD_RECORD_ID" jdbcType="NUMERIC" property="uploadRecordId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -80,7 +81,7 @@
<sql id="Base_Column_List">
ID, BIZ_ID, BIZ_TYPE_ID, BIZ_TYPE_NAME, SOURCE_FILE_NAME, FILE_NAME, FILE_PATH, FILE_TYPE_ID,
FILE_TYPE_NAME, STATUS, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, MODIFY_TIME,
MODIFY_USER_ID, MODIFY_USER_NAME
MODIFY_USER_ID, MODIFY_USER_NAME, UPLOAD_RECORD_ID
</sql>
<select id="selectByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultMap="BaseResultMap">
<include refid="OracleDialectPrefix" />
......@@ -124,13 +125,13 @@
FILE_PATH, FILE_TYPE_ID, FILE_TYPE_NAME,
STATUS, CREATE_TIME, CREATE_USER_ID,
CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID,
MODIFY_USER_NAME)
MODIFY_USER_NAME, UPLOAD_RECORD_ID)
values (#{id,jdbcType=NUMERIC}, #{bizId,jdbcType=NUMERIC}, #{bizTypeId,jdbcType=NUMERIC},
#{bizTypeName,jdbcType=VARCHAR}, #{sourceFileName,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR},
#{filePath,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=NUMERIC}, #{fileTypeName,jdbcType=VARCHAR},
#{status,jdbcType=NUMERIC}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC},
#{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC},
#{modifyUserName,jdbcType=VARCHAR})
#{modifyUserName,jdbcType=VARCHAR}, #{uploadRecordId,jdbcType=NUMERIC})
</insert>
<insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.Attachment">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
......@@ -184,6 +185,9 @@
<if test="modifyUserName != null">
MODIFY_USER_NAME,
</if>
<if test="uploadRecordId != null">
UPLOAD_RECORD_ID,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=NUMERIC},
......@@ -232,6 +236,9 @@
<if test="modifyUserName != null">
#{modifyUserName,jdbcType=VARCHAR},
</if>
<if test="uploadRecordId != null">
#{uploadRecordId,jdbcType=NUMERIC},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultType="java.lang.Long">
......@@ -291,6 +298,9 @@
<if test="record.modifyUserName != null">
MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
</if>
<if test="record.uploadRecordId != null">
UPLOAD_RECORD_ID = #{record.uploadRecordId,jdbcType=NUMERIC},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -313,7 +323,8 @@
CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR},
MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}
MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
UPLOAD_RECORD_ID = #{record.uploadRecordId,jdbcType=NUMERIC}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -366,6 +377,9 @@
<if test="modifyUserName != null">
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
</if>
<if test="uploadRecordId != null">
UPLOAD_RECORD_ID = #{uploadRecordId,jdbcType=NUMERIC},
</if>
</set>
where ID = #{id,jdbcType=NUMERIC}
</update>
......@@ -385,7 +399,8 @@
CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
UPLOAD_RECORD_ID = #{uploadRecordId,jdbcType=NUMERIC}
where ID = #{id,jdbcType=NUMERIC}
</update>
<sql id="OracleDialectPrefix">
......
......@@ -48,6 +48,10 @@
<result column="STATUS_NAME" jdbcType="VARCHAR" property="statusName" />
<result column="DOC_NONDOC_FLAG" jdbcType="VARCHAR" property="docNondocFlag" />
<result column="USER_UUID" jdbcType="VARCHAR" property="userUuid" />
<result column="USER_INPUT_SHIPPER_ACCOUNT" jdbcType="VARCHAR" property="userInputShipperAccount" />
<result column="USER_INPUT_ORIGIN_COUNTRY_ID" jdbcType="NUMERIC" property="userInputOriginCountryId" />
<result column="USER_INPUT_ORIGIN_COUNTRY" jdbcType="VARCHAR" property="userInputOriginCountry" />
<result column="ORIGIN_COUNTRY_ID" jdbcType="NUMERIC" property="originCountryId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -116,7 +120,8 @@
RECIPIENT_CITY, FIRST_COMMIT_TIME, FIRST_SUBMITTER_ID, FIRST_SUBMITTER, COMMIT_TIME,
SUBMITTER_ID, SUBMITTER, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, MODIFY_TIME,
MODIFY_USER_ID, MODIFY_USER_NAME, CE_INFO_ID, RECIPIENT_POSTAL_CODE, STATUS_ID, STATUS_NAME,
DOC_NONDOC_FLAG, USER_UUID
DOC_NONDOC_FLAG, USER_UUID, USER_INPUT_SHIPPER_ACCOUNT, USER_INPUT_ORIGIN_COUNTRY_ID,
USER_INPUT_ORIGIN_COUNTRY, ORIGIN_COUNTRY_ID
</sql>
<select id="selectByExample" parameterType="com.fedex.connect.common.model.biz.ConsignmentExample" resultMap="BaseResultMap">
<include refid="OracleDialectPrefix" />
......@@ -170,7 +175,9 @@
CREATE_USER_ID, CREATE_USER_NAME, MODIFY_TIME,
MODIFY_USER_ID, MODIFY_USER_NAME, CE_INFO_ID,
RECIPIENT_POSTAL_CODE, STATUS_ID, STATUS_NAME,
DOC_NONDOC_FLAG, USER_UUID)
DOC_NONDOC_FLAG, USER_UUID, USER_INPUT_SHIPPER_ACCOUNT,
USER_INPUT_ORIGIN_COUNTRY_ID, USER_INPUT_ORIGIN_COUNTRY,
ORIGIN_COUNTRY_ID)
values (#{id,jdbcType=NUMERIC}, #{consignmentCode,jdbcType=VARCHAR}, #{shipDate,jdbcType=TIMESTAMP},
#{shipperCountry,jdbcType=VARCHAR}, #{recipientCountry,jdbcType=VARCHAR}, #{destIataCode,jdbcType=VARCHAR},
#{originCountry,jdbcType=VARCHAR}, #{destinationCountry,jdbcType=VARCHAR}, #{customsCurrency,jdbcType=VARCHAR},
......@@ -186,7 +193,9 @@
#{createUserId,jdbcType=NUMERIC}, #{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP},
#{modifyUserId,jdbcType=NUMERIC}, #{modifyUserName,jdbcType=VARCHAR}, #{ceInfoId,jdbcType=NUMERIC},
#{recipientPostalCode,jdbcType=VARCHAR}, #{statusId,jdbcType=NUMERIC}, #{statusName,jdbcType=VARCHAR},
#{docNondocFlag,jdbcType=VARCHAR}, #{userUuid,jdbcType=VARCHAR})
#{docNondocFlag,jdbcType=VARCHAR}, #{userUuid,jdbcType=VARCHAR}, #{userInputShipperAccount,jdbcType=VARCHAR},
#{userInputOriginCountryId,jdbcType=NUMERIC}, #{userInputOriginCountry,jdbcType=VARCHAR},
#{originCountryId,jdbcType=NUMERIC})
</insert>
<insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.Consignment">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
......@@ -330,6 +339,18 @@
<if test="userUuid != null">
USER_UUID,
</if>
<if test="userInputShipperAccount != null">
USER_INPUT_SHIPPER_ACCOUNT,
</if>
<if test="userInputOriginCountryId != null">
USER_INPUT_ORIGIN_COUNTRY_ID,
</if>
<if test="userInputOriginCountry != null">
USER_INPUT_ORIGIN_COUNTRY,
</if>
<if test="originCountryId != null">
ORIGIN_COUNTRY_ID,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=NUMERIC},
......@@ -468,6 +489,18 @@
<if test="userUuid != null">
#{userUuid,jdbcType=VARCHAR},
</if>
<if test="userInputShipperAccount != null">
#{userInputShipperAccount,jdbcType=VARCHAR},
</if>
<if test="userInputOriginCountryId != null">
#{userInputOriginCountryId,jdbcType=NUMERIC},
</if>
<if test="userInputOriginCountry != null">
#{userInputOriginCountry,jdbcType=VARCHAR},
</if>
<if test="originCountryId != null">
#{originCountryId,jdbcType=NUMERIC},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.biz.ConsignmentExample" resultType="java.lang.Long">
......@@ -617,6 +650,18 @@
<if test="record.userUuid != null">
USER_UUID = #{record.userUuid,jdbcType=VARCHAR},
</if>
<if test="record.userInputShipperAccount != null">
USER_INPUT_SHIPPER_ACCOUNT = #{record.userInputShipperAccount,jdbcType=VARCHAR},
</if>
<if test="record.userInputOriginCountryId != null">
USER_INPUT_ORIGIN_COUNTRY_ID = #{record.userInputOriginCountryId,jdbcType=NUMERIC},
</if>
<if test="record.userInputOriginCountry != null">
USER_INPUT_ORIGIN_COUNTRY = #{record.userInputOriginCountry,jdbcType=VARCHAR},
</if>
<if test="record.originCountryId != null">
ORIGIN_COUNTRY_ID = #{record.originCountryId,jdbcType=NUMERIC},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -669,7 +714,11 @@
STATUS_ID = #{record.statusId,jdbcType=NUMERIC},
STATUS_NAME = #{record.statusName,jdbcType=VARCHAR},
DOC_NONDOC_FLAG = #{record.docNondocFlag,jdbcType=VARCHAR},
USER_UUID = #{record.userUuid,jdbcType=VARCHAR}
USER_UUID = #{record.userUuid,jdbcType=VARCHAR},
USER_INPUT_SHIPPER_ACCOUNT = #{record.userInputShipperAccount,jdbcType=VARCHAR},
USER_INPUT_ORIGIN_COUNTRY_ID = #{record.userInputOriginCountryId,jdbcType=NUMERIC},
USER_INPUT_ORIGIN_COUNTRY = #{record.userInputOriginCountry,jdbcType=VARCHAR},
ORIGIN_COUNTRY_ID = #{record.originCountryId,jdbcType=NUMERIC}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -812,6 +861,18 @@
<if test="userUuid != null">
USER_UUID = #{userUuid,jdbcType=VARCHAR},
</if>
<if test="userInputShipperAccount != null">
USER_INPUT_SHIPPER_ACCOUNT = #{userInputShipperAccount,jdbcType=VARCHAR},
</if>
<if test="userInputOriginCountryId != null">
USER_INPUT_ORIGIN_COUNTRY_ID = #{userInputOriginCountryId,jdbcType=NUMERIC},
</if>
<if test="userInputOriginCountry != null">
USER_INPUT_ORIGIN_COUNTRY = #{userInputOriginCountry,jdbcType=VARCHAR},
</if>
<if test="originCountryId != null">
ORIGIN_COUNTRY_ID = #{originCountryId,jdbcType=NUMERIC},
</if>
</set>
where ID = #{id,jdbcType=NUMERIC}
</update>
......@@ -861,7 +922,11 @@
STATUS_ID = #{statusId,jdbcType=NUMERIC},
STATUS_NAME = #{statusName,jdbcType=VARCHAR},
DOC_NONDOC_FLAG = #{docNondocFlag,jdbcType=VARCHAR},
USER_UUID = #{userUuid,jdbcType=VARCHAR}
USER_UUID = #{userUuid,jdbcType=VARCHAR},
USER_INPUT_SHIPPER_ACCOUNT = #{userInputShipperAccount,jdbcType=VARCHAR},
USER_INPUT_ORIGIN_COUNTRY_ID = #{userInputOriginCountryId,jdbcType=NUMERIC},
USER_INPUT_ORIGIN_COUNTRY = #{userInputOriginCountry,jdbcType=VARCHAR},
ORIGIN_COUNTRY_ID = #{originCountryId,jdbcType=NUMERIC}
where ID = #{id,jdbcType=NUMERIC}
</update>
<sql id="OracleDialectPrefix">
......
......@@ -89,6 +89,11 @@ public class Attachment implements Serializable {
*/
private String modifyUserName;
/**
* 用户上传记录表ID
*/
private Long uploadRecordId;
private static final long serialVersionUID = 1L;
public Long getId() {
......@@ -219,6 +224,14 @@ public class Attachment implements Serializable {
this.modifyUserName = modifyUserName == null ? null : modifyUserName.trim();
}
public Long getUploadRecordId() {
return uploadRecordId;
}
public void setUploadRecordId(Long uploadRecordId) {
this.uploadRecordId = uploadRecordId;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
......@@ -241,6 +254,7 @@ public class Attachment implements Serializable {
sb.append(", modifyTime=").append(modifyTime);
sb.append(", modifyUserId=").append(modifyUserId);
sb.append(", modifyUserName=").append(modifyUserName);
sb.append(", uploadRecordId=").append(uploadRecordId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
......
......@@ -1154,6 +1154,66 @@ public class AttachmentExample {
addCriterion("MODIFY_USER_NAME not between", value1, value2, "modifyUserName");
return (Criteria) this;
}
public Criteria andUploadRecordIdIsNull() {
addCriterion("UPLOAD_RECORD_ID is null");
return (Criteria) this;
}
public Criteria andUploadRecordIdIsNotNull() {
addCriterion("UPLOAD_RECORD_ID is not null");
return (Criteria) this;
}
public Criteria andUploadRecordIdEqualTo(Long value) {
addCriterion("UPLOAD_RECORD_ID =", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdNotEqualTo(Long value) {
addCriterion("UPLOAD_RECORD_ID <>", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdGreaterThan(Long value) {
addCriterion("UPLOAD_RECORD_ID >", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdGreaterThanOrEqualTo(Long value) {
addCriterion("UPLOAD_RECORD_ID >=", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdLessThan(Long value) {
addCriterion("UPLOAD_RECORD_ID <", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdLessThanOrEqualTo(Long value) {
addCriterion("UPLOAD_RECORD_ID <=", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdIn(List<Long> values) {
addCriterion("UPLOAD_RECORD_ID in", values, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdNotIn(List<Long> values) {
addCriterion("UPLOAD_RECORD_ID not in", values, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdBetween(Long value1, Long value2) {
addCriterion("UPLOAD_RECORD_ID between", value1, value2, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdNotBetween(Long value1, Long value2) {
addCriterion("UPLOAD_RECORD_ID not between", value1, value2, "uploadRecordId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
......@@ -240,6 +240,28 @@ public class Consignment implements Serializable {
*/
private String userUuid;
/**
* 用户录入发货人计费账号
*/
private String userInputShipperAccount;
/**
* 用户录入原产国全称
*/
private Long userInputOriginCountryId;
/**
* 用户录入原产国全称ID,
关联数据字典表。指定字典目录CODE:COUNTRY
*/
private String userInputOriginCountry;
/**
* 原产国全称ID,
关联数据字典表。指定字典目录CODE:COUNTRY
*/
private Long originCountryId;
private static final long serialVersionUID = 1L;
public Long getId() {
......@@ -610,6 +632,38 @@ public class Consignment implements Serializable {
this.userUuid = userUuid == null ? null : userUuid.trim();
}
public String getUserInputShipperAccount() {
return userInputShipperAccount;
}
public void setUserInputShipperAccount(String userInputShipperAccount) {
this.userInputShipperAccount = userInputShipperAccount == null ? null : userInputShipperAccount.trim();
}
public Long getUserInputOriginCountryId() {
return userInputOriginCountryId;
}
public void setUserInputOriginCountryId(Long userInputOriginCountryId) {
this.userInputOriginCountryId = userInputOriginCountryId;
}
public String getUserInputOriginCountry() {
return userInputOriginCountry;
}
public void setUserInputOriginCountry(String userInputOriginCountry) {
this.userInputOriginCountry = userInputOriginCountry == null ? null : userInputOriginCountry.trim();
}
public Long getOriginCountryId() {
return originCountryId;
}
public void setOriginCountryId(Long originCountryId) {
this.originCountryId = originCountryId;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
......@@ -662,6 +716,10 @@ public class Consignment implements Serializable {
sb.append(", statusName=").append(statusName);
sb.append(", docNondocFlag=").append(docNondocFlag);
sb.append(", userUuid=").append(userUuid);
sb.append(", userInputShipperAccount=").append(userInputShipperAccount);
sb.append(", userInputOriginCountryId=").append(userInputOriginCountryId);
sb.append(", userInputOriginCountry=").append(userInputOriginCountry);
sb.append(", originCountryId=").append(originCountryId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
......
package com.fedex.connect.common.model.biz;
import java.io.Serializable;
import java.util.Date;
/**
* DESC: 用户上传记录表
* TABLE: T_BIZ_UPLOAD_RECORD
*/
public class UploadRecord implements Serializable {
/**
* ID,自动增加
*/
private Long id;
/**
* 运单ID,关联运单表ID
*/
private Long consignmentId;
/**
* 上传状态(uploaded)
*/
private String uploadStatus;
/**
* 状态(0:无效、1:有效)
*/
private Long status;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建人ID,关联用户表ID
*/
private Long createUserId;
/**
* 创建人名称
*/
private String createUserName;
/**
* 修改时间
*/
private Date modifyTime;
/**
* 修改人ID,关联用户表ID
*/
private Long modifyUserId;
/**
* 修改人名称
*/
private String modifyUserName;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getConsignmentId() {
return consignmentId;
}
public void setConsignmentId(Long consignmentId) {
this.consignmentId = consignmentId;
}
public String getUploadStatus() {
return uploadStatus;
}
public void setUploadStatus(String uploadStatus) {
this.uploadStatus = uploadStatus == null ? null : uploadStatus.trim();
}
public Long getStatus() {
return status;
}
public void setStatus(Long status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName == null ? null : createUserName.trim();
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public Long getModifyUserId() {
return modifyUserId;
}
public void setModifyUserId(Long modifyUserId) {
this.modifyUserId = modifyUserId;
}
public String getModifyUserName() {
return modifyUserName;
}
public void setModifyUserName(String modifyUserName) {
this.modifyUserName = modifyUserName == null ? null : modifyUserName.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", consignmentId=").append(consignmentId);
sb.append(", uploadStatus=").append(uploadStatus);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", createUserId=").append(createUserId);
sb.append(", createUserName=").append(createUserName);
sb.append(", modifyTime=").append(modifyTime);
sb.append(", modifyUserId=").append(modifyUserId);
sb.append(", modifyUserName=").append(modifyUserName);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
......@@ -93,12 +93,18 @@
<!-- selectByExampleQueryId="true">-->
<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_LOG_EMAIL_HISTORY.NEXTVAL FROM DUAL" />-->
<!-- </table>-->
<!-- <table tableName="T_BIZ_ATTACHMENT" domainObjectName="Attachment"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableDeleteByExample="true" enableSelectByExample="true"-->
<!-- selectByExampleQueryId="true">-->
<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL" />-->
<!-- </table>-->
<table tableName="T_BIZ_ATTACHMENT" domainObjectName="Attachment"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true">
<generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL" />
</table>
<table tableName="T_BIZ_UPLOAD_RECORD" domainObjectName="UploadRecord"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true">
<generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_UPLOAD_RECORD.NEXTVAL FROM DUAL" />
</table>
<!-- <table schema="ICLEARIMP" tableName="T_BIZ_CE_INFO" domainObjectName="CeInfo"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableDeleteByExample="true" enableSelectByExample="true"-->
......
package com.fedex.connect.common.dependencies.authentication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
/**
* 读取配置文件
* @author Administrator
*/
@ConfigurationProperties(prefix = "export.jwt")
@Configuration
@ConfigurationProperties(prefix = "import.jwt")
@PropertySource("classpath:application.yml")
public class SecurityConstants {
/**
......
......@@ -73,6 +73,9 @@ public class JwtAuthorizationFilter extends BasicAuthenticationFilter {
LocaleMessageUtil localeMessageUtil = SpringBeanUtil.getBean(LocaleMessageUtil.class);
IRedisSlabService redisSlabService = SpringBeanUtil.getBean(IRedisSlabService.class);
String str = localeMessageUtil.getMessage("auth_filter_user_error");
System.out.println(str);
if (token == null || !token.startsWith(SecurityConstants.TOKEN_PREFIX)) {
SecurityContextHolder.clearContext();
......
......@@ -2,15 +2,18 @@ package com.fedex.connect.common.dependencies.i18n;
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceResolvable;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Locale;
/**
* 根据语言编码查询内容
*/
@Component
@PropertySource("classpath:application.yml")
public class LocaleMessageUtil {
@Resource
......
......@@ -31,12 +31,12 @@ public class SwaggerConfig {
/**
* 扫描Controller包的路径
*/
public static final String BASE_PACKAGE = "com.fedex.export.controller";
public static final String BASE_PACKAGE = "com.fedex.connect.kafka.controller";
/**
* API信息
*/
public static final String API_INFO = "Export TW APIs";
public static final String API_INFO = "iClear Connect-Pre-Clearance Kafka-cndc-server APIs";
public static final String API_VERSION = "1.0";
/**
......
......@@ -9,7 +9,25 @@ spring:
active: @activatedProperties@
messages:
basename: message
encoding: utf-8
import:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /kafka-cndc-server/auth
- /kafka-cndc-server/monitor/ok
- /kafka-cndc-server/user/logout
- /kafka-cndc-server/swagger-resources
- /kafka-cndc-server/webjars
- /kafka-cndc-server/csrf
uriWhiteList:
- /kafka-cndc-server/swagger-ui.html
- /kafka-cndc-server/swagger-ui/*
- /kafka-cndc-server/v2/api-docs
- /kafka-cndc-server/login.html
expire_1H: 7200
expire_1D: 604800
mybatis:
mapper-locations:
......
#authentication包
auth_exc_no_auth=沒有訪問許可權
auth_exc_no_pass_auth=沒有通過許可權認證
auth_filter_user_error=登錄身份異常
auth_filter_timeout=登錄超過8小時,請重新登錄
auth_filter_stale_dated=登錄已過期
enum_res_code_301=登錄身份異常
enum_res_code_305=登錄已過期,請重新登錄
\ No newline at end of file
#authentication包
auth_exc_no_auth=沒有訪問許可權
auth_exc_no_pass_auth=沒有通過許可權認證
auth_filter_user_error=登錄身份異常
auth_filter_timeout=登錄超過8小時,請重新登錄
auth_filter_stale_dated=登錄已過期
enum_res_code_301=登錄身份異常
enum_res_code_305=登錄已過期,請重新登錄
\ No newline at end of file
package com.fedex.connect.manager.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
/**
* SwaggerConfig配置类.开启Swagger2,自动生成文档
*
* @author EDY
*/
@Configuration
@EnableSwagger2
@Profile({"dev", "test", "uat"})
public class SwaggerConfig {
/**
* 扫描Controller包的路径
*/
public static final String BASE_PACKAGE = "com.fedex.connect.manager.controller";
/**
* API信息
*/
public static final String API_INFO = "iClear Connect-Pre-Clearance Manager-server APIs";
public static final String API_VERSION = "1.0";
/**
* 创建API应用
*
* @return
*/
@Bean
public Docket restApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo(API_INFO, API_VERSION))
.useDefaultResponseMessages(true)
.forCodeGeneration(false)
.select()
// 扫描指定目录的API
.apis(RequestHandlerSelectors.basePackage(BASE_PACKAGE))
.paths(PathSelectors.any())
.build()
//配置全局io.swagger.model
.securitySchemes(securitySchemes())
//配置将安全上下文应用于哪些api操作(通过正则表达式模式)和HTTP方法
.securityContexts(securityContexts());
}
/**
* API的基本信息
*
* @return
*/
private ApiInfo apiInfo(String title, String version) {
return new ApiInfoBuilder().title(title).description(API_INFO).version(version).build();
}
private List<ApiKey> securitySchemes() {
List<ApiKey> apiKeys = new ArrayList<>();
/*SecurityConstants.TOKEN_HEADER*/
apiKeys.add(new ApiKey("Authorization", "Authorization", "header"));
return apiKeys;
}
private List<SecurityContext> securityContexts() {
List<SecurityContext> securityContexts = new ArrayList<>();
securityContexts.add(SecurityContext.builder()
.securityReferences(defaultAuth())
//指定/auth 请求下不会携带全局参数
.forPaths(PathSelectors.regex("^(?!/auth).*$")).build());
return securityContexts;
}
private List<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
List<SecurityReference> securityReferences = new ArrayList<>();
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
return securityReferences;
}
}
......@@ -20,6 +20,23 @@ spring:
basename: message
encoding: utf-8
import:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /manager-server/auth
- /manager-server/monitor/ok
- /manager-server/user/logout
- /manager-server/swagger-resources
- /manager-server/webjars
uriWhiteList:
- /manager-server/swagger-ui.html
- /manager-server/swagger-ui/*
- /manager-server/v2/api-docs
- /manager-server/login.html
expire_1H: 7200
expire_1D: 604800
mybatis:
mapper-locations:
- classpath*:com/fedex/connect/**/mapper/**/*.xml
......
#authentication包
auth_exc_no_auth=沒有訪問許可權
auth_exc_no_pass_auth=沒有通過許可權認證
auth_filter_user_error=登錄身份異常
auth_filter_timeout=登錄超過8小時,請重新登錄
auth_filter_stale_dated=登錄已過期
\ No newline at end of file
#authentication包
auth_exc_no_auth=沒有訪問許可權
auth_exc_no_pass_auth=沒有通過許可權認證
auth_filter_user_error=登錄身份異常
auth_filter_timeout=登錄超過8小時,請重新登錄
auth_filter_stale_dated=登錄已過期
\ No newline at end of file
......
#authentication包
auth_exc_no_auth=沒有訪問許可權
auth_exc_no_pass_auth=沒有通過許可權認證
auth_filter_user_error=登錄身份異常
auth_filter_timeout=登錄超過8小時,請重新登錄
auth_filter_stale_dated=登錄已過期
\ No newline at end of file
......