custauth
This commit is contained in:
parent
4e7f640edc
commit
803ec86332
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.auth.constant;
|
||||
package net.xnzn.constant;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.auth.constant;
|
||||
package net.xnzn.constant;
|
||||
|
||||
public enum DelFlagEnum {
|
||||
DEL_TRUE(1, "删除"),
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.auth.domain;
|
||||
package net.xnzn.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.auth.domain;
|
||||
package net.xnzn.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.auth.domain;
|
||||
package net.xnzn.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.auth.domain;
|
||||
package net.xnzn.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -1,68 +1,68 @@
|
|||
package net.xnzn.utils;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
public class LeRequest<T> {
|
||||
@ApiModelProperty("版本控制")
|
||||
private String version;
|
||||
@ApiModelProperty("随机字符串")
|
||||
private String nonceStr;
|
||||
@ApiModelProperty("时间戳")
|
||||
private String timestamp;
|
||||
@ApiModelProperty("签名类型")
|
||||
private String signType;
|
||||
@ApiModelProperty("业务参数")
|
||||
private @Valid T content;
|
||||
@ApiModelProperty("签名")
|
||||
private String sign;
|
||||
|
||||
public String getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public String getNonceStr() {
|
||||
return this.nonceStr;
|
||||
}
|
||||
|
||||
public String getTimestamp() {
|
||||
return this.timestamp;
|
||||
}
|
||||
|
||||
public String getSignType() {
|
||||
return this.signType;
|
||||
}
|
||||
|
||||
public T getContent() {
|
||||
return this.content;
|
||||
}
|
||||
|
||||
public String getSign() {
|
||||
return this.sign;
|
||||
}
|
||||
|
||||
public void setVersion(final String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public void setNonceStr(final String nonceStr) {
|
||||
this.nonceStr = nonceStr;
|
||||
}
|
||||
|
||||
public void setTimestamp(final String timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public void setSignType(final String signType) {
|
||||
this.signType = signType;
|
||||
}
|
||||
|
||||
public void setContent(final T content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public void setSign(final String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
}
|
||||
//package net.xnzn.utils;
|
||||
//
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//
|
||||
//import javax.validation.Valid;
|
||||
//
|
||||
//public class LeRequest<T> {
|
||||
// @ApiModelProperty("版本控制")
|
||||
// private String version;
|
||||
// @ApiModelProperty("随机字符串")
|
||||
// private String nonceStr;
|
||||
// @ApiModelProperty("时间戳")
|
||||
// private String timestamp;
|
||||
// @ApiModelProperty("签名类型")
|
||||
// private String signType;
|
||||
// @ApiModelProperty("业务参数")
|
||||
// private @Valid T content;
|
||||
// @ApiModelProperty("签名")
|
||||
// private String sign;
|
||||
//
|
||||
// public String getVersion() {
|
||||
// return this.version;
|
||||
// }
|
||||
//
|
||||
// public String getNonceStr() {
|
||||
// return this.nonceStr;
|
||||
// }
|
||||
//
|
||||
// public String getTimestamp() {
|
||||
// return this.timestamp;
|
||||
// }
|
||||
//
|
||||
// public String getSignType() {
|
||||
// return this.signType;
|
||||
// }
|
||||
//
|
||||
// public T getContent() {
|
||||
// return this.content;
|
||||
// }
|
||||
//
|
||||
// public String getSign() {
|
||||
// return this.sign;
|
||||
// }
|
||||
//
|
||||
// public void setVersion(final String version) {
|
||||
// this.version = version;
|
||||
// }
|
||||
//
|
||||
// public void setNonceStr(final String nonceStr) {
|
||||
// this.nonceStr = nonceStr;
|
||||
// }
|
||||
//
|
||||
// public void setTimestamp(final String timestamp) {
|
||||
// this.timestamp = timestamp;
|
||||
// }
|
||||
//
|
||||
// public void setSignType(final String signType) {
|
||||
// this.signType = signType;
|
||||
// }
|
||||
//
|
||||
// public void setContent(final T content) {
|
||||
// this.content = content;
|
||||
// }
|
||||
//
|
||||
// public void setSign(final String sign) {
|
||||
// this.sign = sign;
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,70 +1,70 @@
|
|||
package net.xnzn.utils;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import net.xnzn.framework.config.response.ResponseWrapper;
|
||||
|
||||
@ApiModel(
|
||||
description = "响应数据"
|
||||
)
|
||||
public class LeResponse<T> extends ResponseWrapper<T> {
|
||||
public static <T> LeResponse<T> succ() {
|
||||
return (LeResponse<T>) restResult(RetCodeEnum.SUCC.getKey(), RetCodeEnum.SUCC.getDesc(), (Object)null);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> succ(T returnData) {
|
||||
return restResult(RetCodeEnum.SUCC.getKey(), RetCodeEnum.SUCC.getDesc(), returnData);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> succ(String msg, T returnData) {
|
||||
return restResult(RetCodeEnum.SUCC.getKey(), msg, returnData);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> succ(RetCodeEnum retCodeEnum) {
|
||||
return (LeResponse<T>) restResult(retCodeEnum.getKey(), retCodeEnum.getDesc(), (Object)null);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> succ(Integer code, String msg) {
|
||||
return (LeResponse<T>) restResult(code, msg, (Object)null);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> fail() {
|
||||
return (LeResponse<T>) restResult(RetCodeEnum.FAIL.getKey(), RetCodeEnum.FAIL.getDesc(), (Object)null);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> fail(String errorMsg) {
|
||||
return (LeResponse<T>) restResult(RetCodeEnum.FAIL.getKey(), errorMsg, (Object)null);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> fail(RetCodeEnum retCodeEnum, String errorMsg) {
|
||||
return (LeResponse<T>) restResult(retCodeEnum.getKey(), errorMsg, (Object)null);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> fail(Integer code, String errorMsg) {
|
||||
return (LeResponse<T>) restResult(code, errorMsg, (Object)null);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> fail(RetCodeEnum retCodeEnum, T returnData) {
|
||||
return restResult(retCodeEnum.getKey(), retCodeEnum.getDesc(), returnData);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> fail(Integer code, T returnData) {
|
||||
return restResult(code, (String)null, returnData);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> fail(RetCodeEnum retCodeEnum, String errorMsg, T returnData) {
|
||||
return restResult(retCodeEnum.getKey(), errorMsg, returnData);
|
||||
}
|
||||
|
||||
public static <T> LeResponse<T> fail(Integer code, String errorMsg, T returnData) {
|
||||
return restResult(code, errorMsg, returnData);
|
||||
}
|
||||
|
||||
private static <T> LeResponse<T> restResult(Integer code, String msg, T returnData) {
|
||||
LeResponse<T> apiResult = new LeResponse();
|
||||
apiResult.setCode(code);
|
||||
apiResult.setMsg(msg);
|
||||
apiResult.setData(returnData);
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
}
|
||||
//package net.xnzn.utils;
|
||||
//
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import net.xnzn.framework.config.response.ResponseWrapper;
|
||||
//
|
||||
//@ApiModel(
|
||||
// description = "响应数据"
|
||||
//)
|
||||
//public class LeResponse<T> extends ResponseWrapper<T> {
|
||||
// public static <T> LeResponse<T> succ() {
|
||||
// return (LeResponse<T>) restResult(RetCodeEnum.SUCC.getKey(), RetCodeEnum.SUCC.getDesc(), (Object)null);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> succ(T returnData) {
|
||||
// return restResult(RetCodeEnum.SUCC.getKey(), RetCodeEnum.SUCC.getDesc(), returnData);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> succ(String msg, T returnData) {
|
||||
// return restResult(RetCodeEnum.SUCC.getKey(), msg, returnData);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> succ(RetCodeEnum retCodeEnum) {
|
||||
// return (LeResponse<T>) restResult(retCodeEnum.getKey(), retCodeEnum.getDesc(), (Object)null);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> succ(Integer code, String msg) {
|
||||
// return (LeResponse<T>) restResult(code, msg, (Object)null);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> fail() {
|
||||
// return (LeResponse<T>) restResult(RetCodeEnum.FAIL.getKey(), RetCodeEnum.FAIL.getDesc(), (Object)null);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> fail(String errorMsg) {
|
||||
// return (LeResponse<T>) restResult(RetCodeEnum.FAIL.getKey(), errorMsg, (Object)null);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> fail(RetCodeEnum retCodeEnum, String errorMsg) {
|
||||
// return (LeResponse<T>) restResult(retCodeEnum.getKey(), errorMsg, (Object)null);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> fail(Integer code, String errorMsg) {
|
||||
// return (LeResponse<T>) restResult(code, errorMsg, (Object)null);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> fail(RetCodeEnum retCodeEnum, T returnData) {
|
||||
// return restResult(retCodeEnum.getKey(), retCodeEnum.getDesc(), returnData);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> fail(Integer code, T returnData) {
|
||||
// return restResult(code, (String)null, returnData);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> fail(RetCodeEnum retCodeEnum, String errorMsg, T returnData) {
|
||||
// return restResult(retCodeEnum.getKey(), errorMsg, returnData);
|
||||
// }
|
||||
//
|
||||
// public static <T> LeResponse<T> fail(Integer code, String errorMsg, T returnData) {
|
||||
// return restResult(code, errorMsg, returnData);
|
||||
// }
|
||||
//
|
||||
// private static <T> LeResponse<T> restResult(Integer code, String msg, T returnData) {
|
||||
// LeResponse<T> apiResult = new LeResponse();
|
||||
// apiResult.setCode(code);
|
||||
// apiResult.setMsg(msg);
|
||||
// apiResult.setData(returnData);
|
||||
// return apiResult;
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ package com.bonus.auth.controller;
|
|||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.bonus.auth.constant.CustLoginTypeEnum;
|
||||
import com.bonus.auth.constant.DelFlagEnum;
|
||||
import com.bonus.auth.domain.CustCasual;
|
||||
import com.bonus.auth.domain.CustInfo;
|
||||
import net.xnzn.constant.CustLoginTypeEnum;
|
||||
import net.xnzn.constant.DelFlagEnum;
|
||||
import net.xnzn.domain.CustCasual;
|
||||
import net.xnzn.domain.CustInfo;
|
||||
import net.xnzn.domain.CustInfoAppIdLoginVO;
|
||||
import com.bonus.auth.factory.LoginStrategyFactory;
|
||||
import com.bonus.auth.form.LoginBody;
|
||||
|
|
@ -26,7 +26,6 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.config.SystemConfig;
|
||||
import com.bonus.system.api.RemoteConfigService;
|
||||
import com.bonus.system.api.RemoteUserService;
|
||||
import com.bonus.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.xnzn.service.TokenService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package com.bonus.auth.mapper;
|
||||
|
||||
import com.bonus.auth.domain.CustCasual;
|
||||
import com.bonus.auth.domain.CustCasualModel;
|
||||
import net.xnzn.domain.CustCasual;
|
||||
import net.xnzn.domain.CustCasualModel;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.auth.mapper;
|
||||
|
||||
import com.bonus.auth.domain.CustInfo;
|
||||
import net.xnzn.domain.CustInfo;
|
||||
import net.xnzn.domain.CustInfoAppIdLoginVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.auth.mapper.CustCasualMapper">
|
||||
|
||||
<resultMap id="custCasualMap" type="com.bonus.auth.domain.CustCasual">
|
||||
<resultMap id="custCasualMap" type="net.xnzn.domain.CustCasual">
|
||||
<id property="id" column="id"/>
|
||||
<result property="casualId" column="casual_id"/>
|
||||
<result property="casualName" column="casual_name"/>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
</resultMap>
|
||||
|
||||
<resultMap id="custCasualModel" extends="custCasualMap"
|
||||
type="com.bonus.auth.domain.CustCasualModel">
|
||||
type="net.xnzn.domain.CustCasualModel">
|
||||
<result property="custNum" column="cust_num"/>
|
||||
<result property="custName" column="cust_name"/>
|
||||
<result property="age" column="age"/>
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<!-- 分页查询临时人员,并关联查询相关人员信息 -->
|
||||
<select id="queryPageCustCasual" resultMap="custCasualModel"
|
||||
parameterType="com.bonus.auth.domain.CustCasual">
|
||||
parameterType="net.xnzn.domain.CustCasual">
|
||||
select *
|
||||
from cust_casual t1
|
||||
left join cust_info t2 on t1.cust_id = t2.cust_id
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
select openid from cust_casual where cust_id = #{custId} and source_type = #{sourceType} and if_del = #{ifDel}
|
||||
</select>
|
||||
|
||||
<select id="selectCustCasualByCustId" resultType="com.bonus.auth.domain.CustCasual">
|
||||
<select id="selectCustCasualByCustId" resultType="net.xnzn.domain.CustCasual">
|
||||
select casual_id, openid from cust_casual where cust_id = #{custId} and source_type = #{sourceType} and if_del = #{ifDel}
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Reference in New Issue