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