提交 f26e5057 编写于 作者: rushui.chen's avatar rushui.chen

20190902 微信信息表修改表结构

上级 3ede406b
流水线 #13895 已失败 于阶段
in 1 second
...@@ -40,6 +40,10 @@ public class LoginController extends AccountBaseController { ...@@ -40,6 +40,10 @@ public class LoginController extends AccountBaseController {
@Autowired @Autowired
private PicaLogUtils picaLogUtils; private PicaLogUtils picaLogUtils;
@Autowired
private AccountUtils accountUtils;
/** /**
* 密码登录接口 * 密码登录接口
* *
...@@ -72,8 +76,8 @@ public class LoginController extends AccountBaseController { ...@@ -72,8 +76,8 @@ public class LoginController extends AccountBaseController {
@PostMapping(value = "/login-register") @PostMapping(value = "/login-register")
public PicaResponse loginAndRegister(@RequestBody EncryptEntity entity) throws Exception { public PicaResponse loginAndRegister(@RequestBody EncryptEntity entity) throws Exception {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class); BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
AccountUtils.checkMobilePhone(request.getMobile()); accountUtils.checkMobilePhone(request.getMobile());
AccountUtils.getAuthCodeKey(request.getSysCode(), EnumsType.SYSCODE_TYPE_REGISTER.getCode() + ""); accountUtils.getAuthCodeKey(request.getMobile(), EnumsType.SYSCODE_TYPE_LOGIN.getCode() + "");
request.setProductType(super.getProductType()); request.setProductType(super.getProductType());
request.setSourceType(super.getSourceType()); request.setSourceType(super.getSourceType());
request.setLoginIp(super.getIpAddr()); request.setLoginIp(super.getIpAddr());
...@@ -92,6 +96,36 @@ public class LoginController extends AccountBaseController { ...@@ -92,6 +96,36 @@ public class LoginController extends AccountBaseController {
return PicaResponse.toResponse(result); return PicaResponse.toResponse(result);
} }
@ApiOperation("微信登录第二步接口")
@PostMapping(value = "/login/wechat/step2")
public PicaResponse loginByWeChatStep(@RequestBody EncryptEntity entity) throws Exception {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
accountUtils.checkMobilePhone(request.getMobile());
accountUtils.checkAuthCode(request.getMobile(), EnumsType.SYSCODE_TYPE_WE_CHAT.getCode() + "", request.getSysCode());
request.setProductType(super.getProductType());
request.setSourceType(super.getSourceType());
request.setLoginIp(super.getIpAddr());
String result = loginService.loginByWeChatStep(request);
return PicaResponse.toResponse(result);
}
/**
* 绑定微信接口
*
* @param entity
* @return
* @throws Exception
*/
@ApiOperation("绑定微信接口")
@PostMapping("/login/wechat/bind")
public PicaResponse<String> bindWeChat(@RequestBody EncryptEntity entity) throws Exception {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
String weChatCode = request.getWeChatCode();
request.setProductType(super.getProductType());
// TODO: 2019/8/29 绑定微信接口
return null;
}
/** /**
* 退出登录接口 * 退出登录接口
* *
...@@ -128,23 +162,6 @@ public class LoginController extends AccountBaseController { ...@@ -128,23 +162,6 @@ public class LoginController extends AccountBaseController {
} }
/**
* 绑定微信接口
*
* @param entity
* @return
* @throws Exception
*/
@ApiOperation("绑定微信接口")
@PostMapping("/login/wechat/bind")
public PicaResponse<String> bindWeChat(@RequestBody EncryptEntity entity) throws Exception {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
String weChatCode = request.getWeChatCode();
request.setProductType(super.getProductType());
// TODO: 2019/8/29 绑定微信接口
return null;
}
@ApiOperation("微信解除绑定接口") @ApiOperation("微信解除绑定接口")
@PostMapping("/login/wechat/unbind") @PostMapping("/login/wechat/unbind")
public PicaResponse unbindWeChat(@RequestBody EncryptEntity entity) throws Exception { public PicaResponse unbindWeChat(@RequestBody EncryptEntity entity) throws Exception {
......
...@@ -11,20 +11,6 @@ public class AccountUnionEntity { ...@@ -11,20 +11,6 @@ public class AccountUnionEntity {
private String unionId; private String unionId;
private String nickname;
private String headImgUrl;
private int sex;
private String country;
private String province;
private String city;
private String language;
private Integer deleteFlag; private Integer deleteFlag;
private Integer createdId; private Integer createdId;
...@@ -67,62 +53,6 @@ public class AccountUnionEntity { ...@@ -67,62 +53,6 @@ public class AccountUnionEntity {
this.unionId = unionId == null ? null : unionId.trim(); this.unionId = unionId == null ? null : unionId.trim();
} }
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname == null ? null : nickname.trim();
}
public String getHeadImgUrl() {
return headImgUrl;
}
public void setHeadImgUrl(String headImgUrl) {
this.headImgUrl = headImgUrl == null ? null : headImgUrl.trim();
}
public int getSex() {
return sex;
}
public void setSex(int sex) {
this.sex = sex;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country == null ? null : country.trim();
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province == null ? null : province.trim();
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city == null ? null : city.trim();
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language == null ? null : language.trim();
}
public Integer getDeleteFlag() { public Integer getDeleteFlag() {
return deleteFlag; return deleteFlag;
} }
......
...@@ -9,6 +9,20 @@ public class AccountWeChatInfoEntity { ...@@ -9,6 +9,20 @@ public class AccountWeChatInfoEntity {
private String openid; private String openid;
private String nickname;
private String headImgUrl;
private int sex;
private String country;
private String province;
private String city;
private String language;
private Integer type; private Integer type;
private String privilege; private String privilege;
...@@ -46,7 +60,7 @@ public class AccountWeChatInfoEntity { ...@@ -46,7 +60,7 @@ public class AccountWeChatInfoEntity {
} }
public void setUnionid(String unionid) { public void setUnionid(String unionid) {
this.unionid = unionid == null ? null : unionid.trim(); this.unionid = unionid;
} }
public String getOpenid() { public String getOpenid() {
...@@ -54,7 +68,63 @@ public class AccountWeChatInfoEntity { ...@@ -54,7 +68,63 @@ public class AccountWeChatInfoEntity {
} }
public void setOpenid(String openid) { public void setOpenid(String openid) {
this.openid = openid == null ? null : openid.trim(); this.openid = openid;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getHeadImgUrl() {
return headImgUrl;
}
public void setHeadImgUrl(String headImgUrl) {
this.headImgUrl = headImgUrl;
}
public int getSex() {
return sex;
}
public void setSex(int sex) {
this.sex = sex;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
} }
public Integer getType() { public Integer getType() {
...@@ -70,7 +140,7 @@ public class AccountWeChatInfoEntity { ...@@ -70,7 +140,7 @@ public class AccountWeChatInfoEntity {
} }
public void setPrivilege(String privilege) { public void setPrivilege(String privilege) {
this.privilege = privilege == null ? null : privilege.trim(); this.privilege = privilege;
} }
public Integer getSubscribe() { public Integer getSubscribe() {
...@@ -94,7 +164,7 @@ public class AccountWeChatInfoEntity { ...@@ -94,7 +164,7 @@ public class AccountWeChatInfoEntity {
} }
public void setRemark(String remark) { public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim(); this.remark = remark;
} }
public String getGroupid() { public String getGroupid() {
...@@ -102,7 +172,7 @@ public class AccountWeChatInfoEntity { ...@@ -102,7 +172,7 @@ public class AccountWeChatInfoEntity {
} }
public void setGroupid(String groupid) { public void setGroupid(String groupid) {
this.groupid = groupid == null ? null : groupid.trim(); this.groupid = groupid;
} }
public String getTagidList() { public String getTagidList() {
...@@ -110,7 +180,7 @@ public class AccountWeChatInfoEntity { ...@@ -110,7 +180,7 @@ public class AccountWeChatInfoEntity {
} }
public void setTagidList(String tagidList) { public void setTagidList(String tagidList) {
this.tagidList = tagidList == null ? null : tagidList.trim(); this.tagidList = tagidList;
} }
public Integer getDeleteFlag() { public Integer getDeleteFlag() {
......
package com.pica.cloud.account.account.server.entity; package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class WeChatEntity { public class WeChatEntity {
//用户唯一标识 /** 获取到的凭证 */
private String access_token;
/** 凭证有效时间,单位:秒 */
private int expires_in;
/** 用户刷新access_token */
private String refresh_token;
/** 用户唯一标识,请注意,在未关注公众号时,用户访问公众号的网页,也会产生一个用户和公众号唯一的OpenID */
private String openid; private String openid;
//会话密钥 /** 用户授权的作用域,使用逗号(,)分隔 */
private String session_key; private String scope;
//用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回,详见 UnionID 机制说明。
private String unionid;
//错误码
private String errcode;
// 错误信息
private String errmsg;
public String getOpenid() { private Date createdAt;
return openid;
public String getAccess_token() {
return access_token;
} }
public void setOpenid(String openid) { public void setAccess_token(String access_token) {
this.openid = openid; this.access_token = access_token;
}
public int getExpires_in() {
return expires_in;
} }
public String getSession_key() { public void setExpires_in(int expires_in) {
return session_key; this.expires_in = expires_in;
} }
public void setSession_key(String session_key) { public String getRefresh_token() {
this.session_key = session_key; return refresh_token;
} }
public String getUnionid() { public void setRefresh_token(String refresh_token) {
return unionid; this.refresh_token = refresh_token;
} }
public void setUnionid(String unionid) { public String getOpenid() {
this.unionid = unionid; return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
} }
public String getErrcode() { public String getScope() {
return errcode; return scope;
} }
public void setErrcode(String errcode) { public void setScope(String scope) {
this.errcode = errcode; this.scope = scope;
} }
public String getErrmsg() { public Date getCreatedAt() {
return errmsg; return createdAt;
} }
public void setErrmsg(String errmsg) { public void setCreatedAt(Date createdAt) {
this.errmsg = errmsg; this.createdAt = createdAt;
} }
} }
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class WeChatUserInfoEntity {
/** 是否订阅该公众号标识 */
private Integer subscribe;
/** 用户标识 */
private String openid;
/** 昵称 */
private String nickname;
/** 性别 */
private Integer sex;
/** 用户所在城市 */
private String city;
/** 用户所在省份 */
private String province;
/** 国家*/
private String country;
/** 用户的语言 */
private String language;
/** 用户头像 */
private String headimgurl;
/** 用户关注时间 */
private Date subscribe_time;
/** 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段 */
private String unionid;
private String remark;
private Integer groupid;
private String tagid_list;
private String privilege;
public Integer getSubscribe() {
return subscribe;
}
public void setSubscribe(Integer subscribe) {
this.subscribe = subscribe;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public String getHeadimgurl() {
return headimgurl;
}
public void setHeadimgurl(String headimgurl) {
this.headimgurl = headimgurl;
}
public Date getSubscribe_time() {
return subscribe_time;
}
public void setSubscribe_time(Date subscribe_time) {
this.subscribe_time = subscribe_time;
}
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getGroupid() {
return groupid;
}
public void setGroupid(Integer groupid) {
this.groupid = groupid;
}
public String getTagid_list() {
return tagid_list;
}
public void setTagid_list(String tagid_list) {
this.tagid_list = tagid_list;
}
public String getPrivilege() {
return privilege;
}
public void setPrivilege(String privilege) {
this.privilege = privilege;
}
}
...@@ -12,17 +12,23 @@ public interface AccountUnionMapper { ...@@ -12,17 +12,23 @@ public interface AccountUnionMapper {
AccountUnionEntity selectByPrimaryKey(Integer id); AccountUnionEntity selectByPrimaryKey(Integer id);
AccountUnionEntity selectByUnionId(String unionId);
int updateByPrimaryKeySelective(AccountUnionEntity record); int updateByPrimaryKeySelective(AccountUnionEntity record);
int updateByPrimaryKey(AccountUnionEntity record); int updateByPrimaryKey(AccountUnionEntity record);
/** /**
* 解除绑定关系 * 解除绑定关系
*
* @param acctId * @param acctId
* @return * @return
*/ */
int updateUnbindByAcctId(Integer acctId); int updateUnbindByAcctId(Integer acctId);
/**
* 是否绑定过手机号
*
* @param unionId
* @return
*/
AccountUnionEntity selectByUnionId(String unionId);
} }
\ No newline at end of file
package com.pica.cloud.account.account.server.mapper; package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity; import com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity;
public interface AccountWeChatInfoMapper { public interface AccountWeChatInfoMapper {
...@@ -15,4 +14,11 @@ public interface AccountWeChatInfoMapper { ...@@ -15,4 +14,11 @@ public interface AccountWeChatInfoMapper {
int updateByPrimaryKeySelective(AccountWeChatInfoEntity record); int updateByPrimaryKeySelective(AccountWeChatInfoEntity record);
int updateByPrimaryKey(AccountWeChatInfoEntity record); int updateByPrimaryKey(AccountWeChatInfoEntity record);
/**
* UnionId 是否存在
* @param id
* @return
*/
AccountWeChatInfoEntity selectByUnionId(String id);
} }
\ No newline at end of file
...@@ -23,6 +23,9 @@ public class BaseRequest { ...@@ -23,6 +23,9 @@ public class BaseRequest {
private String unionId; private String unionId;
@ApiModelProperty("微信code") @ApiModelProperty("微信code")
private String weChatCode; private String weChatCode;
@ApiModelProperty("微信登录类型")
private Integer weChatLoginType;
public Integer getAccId() { public Integer getAccId() {
return accId; return accId;
...@@ -111,4 +114,12 @@ public class BaseRequest { ...@@ -111,4 +114,12 @@ public class BaseRequest {
public void setWeChatCode(String weChatCode) { public void setWeChatCode(String weChatCode) {
this.weChatCode = weChatCode; this.weChatCode = weChatCode;
} }
public Integer getWeChatLoginType() {
return weChatLoginType;
}
public void setWeChatLoginType(Integer weChatLoginType) {
this.weChatLoginType = weChatLoginType;
}
} }
...@@ -26,6 +26,14 @@ public interface LoginService { ...@@ -26,6 +26,14 @@ public interface LoginService {
*/ */
String loginByWeChat(BaseRequest baseRequest); String loginByWeChat(BaseRequest baseRequest);
/**
* 微信登陆第二步
*
* @param request
* @return
*/
String loginByWeChatStep(BaseRequest request);
/** /**
* 解除绑定 * 解除绑定
* *
......
package com.pica.cloud.account.account.server.service.impl; package com.pica.cloud.account.account.server.service.impl;
import com.pica.cloud.account.account.server.entity.AccountUnionEntity; import com.pica.cloud.account.account.server.entity.AccountUnionEntity;
import com.pica.cloud.account.account.server.mapper.AccountUnionMapper;
import com.pica.cloud.account.account.server.service.AccountUnionService; import com.pica.cloud.account.account.server.service.AccountUnionService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
package com.pica.cloud.account.account.server.util;
import javax.net.ssl.X509TrustManager;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
/**
* 证书信任管理器(用于https请求)
*
* @author bo.dang
* @date 2014-12-04
*/
public class MyX509TrustManager implements X509TrustManager {
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}
\ No newline at end of file
package com.pica.cloud.account.account.server.util;
import com.alibaba.fastjson.JSON;
import com.pica.cloud.account.account.server.entity.WeChatEntity;
import com.pica.cloud.account.account.server.entity.WeChatUserInfoEntity;
import com.pica.cloud.foundation.utils.constants.WeChatConstants;
import com.pica.cloud.foundation.utils.utils.JsonUtil;
import com.pica.cloud.foundation.utils.utils.StringUtil;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class WeChatUtils {
private static Logger logger = LoggerFactory.getLogger(WeChatUtils.class);
public static WeChatEntity getAuthorizationInfo(String appId, String appSecret, String code) {
logger.info("网页授权获取access_token: code:{}", code);
String requestUrl = WeChatConstants.AUTH_ACCESS_TOKEN_URL.replace("APPID", appId).replace("SECRET", appSecret).replace("CODE", code);
JSONObject jsonObject = WeChatToolUtil.httpRequest(requestUrl, "GET", null);
WeChatEntity accessToken = null;
// 如果请求成功
if (null != jsonObject) {
try {
accessToken = JsonUtil.toGsonBean(jsonObject.toString(), WeChatEntity.class);
logger.info("网页授权获取access_token: access_token:{} openid:{}", accessToken.getAccess_token(), accessToken.getOpenid());
} catch (JSONException e) {
// 获取token失败
logger.error("获取token失败 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
}
} else {
// 获取token失败
logger.error("获取token失败 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
}
return accessToken;
}
public static Map getWeChatUserInfo(Map map, String url) {
String param = "access_token=" + map.get("access_token") + "&openid=" + map.get("openid") + "&lang=zh_CN";
List<NameValuePair> nameValuePairs = URLEncodedUtils.parse(param, Charset.forName("utf-8"));
HttpGet method = null;
try {
url = url + param;
URL url1 = new URL(url);
URI uri = new URI(url1.getProtocol(), url1.getHost(), url1.getPath(), url1.getQuery(), null);
method = new HttpGet(uri);
// 建立一个NameValuePair数组,用于存储欲传送的参数
method.addHeader("Content-type", "application/json; charset=utf-8");
method.setHeader("Accept", "application/json");
HttpResponse response = HttpClients.createDefault().execute(method);
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode == HttpStatus.SC_OK) {
String body = EntityUtils.toString(response.getEntity(), "utf-8");
return JSON.parseObject(body, Map.class);
} else {
logger.warn("微信获取用户信息(包括UnionID)失败,param:{}, result:{}", JSON.toJSONString(map), JSON.toJSONString(response));
return new HashMap();
}
} catch (IOException e) {
logger.error("微信获取access_token异常,param:{}", JSON.toJSONString(map), e);
return new HashMap();
} catch (URISyntaxException e) {
logger.error("异常抛出exception ", e);
} finally {
if (method != null) {
method.releaseConnection();
}
}
return new HashMap();
}
public static WeChatUserInfoEntity mergeWechatUserInfo(Map map, String openid){
WeChatUserInfoEntity user = new WeChatUserInfoEntity();
user.setOpenid(openid);
user.setLanguage("zh_CN");
if (StringUtil.isNotNull(map) && map.size() > 0) {
user.setSubscribe((Integer) map.get("subscribe"));
user.setNickname((String) (map.get("nickname")));
user.setSex((Integer) map.get("sex"));
user.setLanguage((String) map.get("language"));
user.setCity((String) map.get("city"));
user.setProvince((String) map.get("province"));
user.setCountry((String) map.get("country"));
user.setHeadimgurl((String) map.get("headimgurl"));
user.setSubscribe_time(new Date(map.get("subscribe_time") == null ? 1501052712L : Long.valueOf(map.get("subscribe_time").toString())));
user.setRemark((String) map.get("remark"));
user.setUnionid((String) map.get("unionid"));
user.setGroupid((Integer) map.get("groupid"));
user.setTagid_list(JSON.toJSONString(map.get("tagid_list")));
}
return user;
}
}
...@@ -34,4 +34,11 @@ ribbon.ConnectTimeout=60000 ...@@ -34,4 +34,11 @@ ribbon.ConnectTimeout=60000
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
memcached.url=192.168.130.230:11211 memcached.url=192.168.130.230:11211
\ No newline at end of file
#微信登陆
weChatAppID=wx5103ed453ef2dbe8
weChatAppSecret=6faa9bef3302786c08b2baf278613f38
weChatURL=https://api.weixin.qq.com/sns/userinfo?
...@@ -34,4 +34,9 @@ ribbon.ConnectTimeout=60000 ...@@ -34,4 +34,9 @@ ribbon.ConnectTimeout=60000
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
memcached.url=172.19.121.31:11211 memcached.url=172.19.121.31:11211
\ No newline at end of file
#微信登陆
weChatAppID=wx5103ed453ef2dbe8
weChatAppSecret=6faa9bef3302786c08b2baf278613f38
weChatURL=https://api.weixin.qq.com/sns/userinfo?
\ No newline at end of file
...@@ -34,4 +34,9 @@ ribbon.ConnectTimeout=60000 ...@@ -34,4 +34,9 @@ ribbon.ConnectTimeout=60000
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
memcached.url=192.168.130.230:11211 memcached.url=192.168.130.230:11211
\ No newline at end of file
#微信登陆
weChatAppID=wx5103ed453ef2dbe8
weChatAppSecret=6faa9bef3302786c08b2baf278613f38
weChatURL=https://api.weixin.qq.com/sns/userinfo?
\ No newline at end of file
...@@ -34,4 +34,9 @@ ribbon.ConnectTimeout=60000 ...@@ -34,4 +34,9 @@ ribbon.ConnectTimeout=60000
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
memcached.url=192.168.130.230:11211 memcached.url=192.168.130.230:11211
\ No newline at end of file
#微信登陆
weChatAppID=wx5103ed453ef2dbe8
weChatAppSecret=6faa9bef3302786c08b2baf278613f38
weChatURL=https://api.weixin.qq.com/sns/userinfo?
\ No newline at end of file
...@@ -34,4 +34,9 @@ ribbon.ConnectTimeout=60000 ...@@ -34,4 +34,9 @@ ribbon.ConnectTimeout=60000
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
memcached.url=192.168.130.230:11211 memcached.url=192.168.130.230:11211
\ No newline at end of file
#微信登陆
weChatAppID=wx5103ed453ef2dbe8
weChatAppSecret=6faa9bef3302786c08b2baf278613f38
weChatURL=https://api.weixin.qq.com/sns/userinfo?
\ No newline at end of file
...@@ -6,13 +6,6 @@ ...@@ -6,13 +6,6 @@
<result column="acct_id" property="acctId" jdbcType="BIGINT"/> <result column="acct_id" property="acctId" jdbcType="BIGINT"/>
<result column="union_type" property="unionType" jdbcType="INTEGER"/> <result column="union_type" property="unionType" jdbcType="INTEGER"/>
<result column="union_id" property="unionId" jdbcType="VARCHAR"/> <result column="union_id" property="unionId" jdbcType="VARCHAR"/>
<result column="nickname" property="nickname" jdbcType="VARCHAR"/>
<result column="head_img_url" property="headImgUrl" jdbcType="VARCHAR"/>
<result column="sex" property="sex" jdbcType="TINYINT"/>
<result column="country" property="country" jdbcType="VARCHAR"/>
<result column="province" property="province" jdbcType="VARCHAR"/>
<result column="city" property="city" jdbcType="VARCHAR"/>
<result column="language" property="language" jdbcType="VARCHAR"/>
<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER"/> <result column="delete_flag" property="deleteFlag" jdbcType="INTEGER"/>
<result column="created_id" property="createdId" jdbcType="INTEGER"/> <result column="created_id" property="createdId" jdbcType="INTEGER"/>
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/> <result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
...@@ -20,9 +13,10 @@ ...@@ -20,9 +13,10 @@
<result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP"/> <result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, acct_id, union_type, union_id, nickname, head_img_url, sex, country, province, id, acct_id, union_type, union_id, delete_flag, created_id, created_time, modified_id,
city, language, delete_flag, created_id, created_time, modified_id, modified_time modified_time
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
...@@ -30,7 +24,6 @@ ...@@ -30,7 +24,6 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<!--通过unionId查询用户信息--> <!--通过unionId查询用户信息-->
<select id="selectByUnionId" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByUnionId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
...@@ -41,29 +34,25 @@ ...@@ -41,29 +34,25 @@
<!--解除绑定关系--> <!--解除绑定关系-->
<update id="updateUnbindByAcctId" parameterType="java.lang.Integer"> <update id="updateUnbindByAcctId" parameterType="java.lang.Integer">
update account_union update account_union
set delete_flag = 2 set delete_flag = 2
where acct_id = #{acctId,jdbcType=INTEGER} where acct_id = #{acctId,jdbcType=INTEGER}
</update> </update>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from account_union delete from account_union
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AccountUnionEntity"> <insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AccountUnionEntity">
insert into account_union (id, acct_id, union_type, insert into account_union (id, acct_id, union_type,
union_id, nickname, head_img_url, union_id, delete_flag, created_id,
sex, country, province, created_time, modified_id, modified_time
city, language, delete_flag, )
created_id, created_time, modified_id,
modified_time)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=BIGINT}, #{unionType,jdbcType=INTEGER}, values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=BIGINT}, #{unionType,jdbcType=INTEGER},
#{unionId,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, #{headImgUrl,jdbcType=VARCHAR}, #{unionId,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER},
#{sex,jdbcType=TINYINT}, #{country,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP}
#{city,jdbcType=VARCHAR}, #{language,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER}, )
#{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER},
#{modifiedTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.AccountUnionEntity"> <insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.AccountUnionEntity">
insert into account_union insert into account_union
...@@ -80,27 +69,6 @@ ...@@ -80,27 +69,6 @@
<if test="unionId != null"> <if test="unionId != null">
union_id, union_id,
</if> </if>
<if test="nickname != null">
nickname,
</if>
<if test="headImgUrl != null">
head_img_url,
</if>
<if test="sex != null">
sex,
</if>
<if test="country != null">
country,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="language != null">
language,
</if>
<if test="deleteFlag != null"> <if test="deleteFlag != null">
delete_flag, delete_flag,
</if> </if>
...@@ -130,27 +98,6 @@ ...@@ -130,27 +98,6 @@
<if test="unionId != null"> <if test="unionId != null">
#{unionId,jdbcType=VARCHAR}, #{unionId,jdbcType=VARCHAR},
</if> </if>
<if test="nickname != null">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="headImgUrl != null">
#{headImgUrl,jdbcType=VARCHAR},
</if>
<if test="sex != null">
#{sex,jdbcType=TINYINT},
</if>
<if test="country != null">
#{country,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
#{city,jdbcType=VARCHAR},
</if>
<if test="language != null">
#{language,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null"> <if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
</if> </if>
...@@ -181,27 +128,6 @@ ...@@ -181,27 +128,6 @@
<if test="unionId != null"> <if test="unionId != null">
union_id = #{unionId,jdbcType=VARCHAR}, union_id = #{unionId,jdbcType=VARCHAR},
</if> </if>
<if test="nickname != null">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="headImgUrl != null">
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=TINYINT},
</if>
<if test="country != null">
country = #{country,jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
city = #{city,jdbcType=VARCHAR},
</if>
<if test="language != null">
language = #{language,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null"> <if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER}, delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if> </if>
...@@ -225,13 +151,6 @@ ...@@ -225,13 +151,6 @@
set acct_id = #{acctId,jdbcType=BIGINT}, set acct_id = #{acctId,jdbcType=BIGINT},
union_type = #{unionType,jdbcType=INTEGER}, union_type = #{unionType,jdbcType=INTEGER},
union_id = #{unionId,jdbcType=VARCHAR}, union_id = #{unionId,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
sex = #{sex,jdbcType=TINYINT},
country = #{country,jdbcType=VARCHAR},
province = #{province,jdbcType=VARCHAR},
city = #{city,jdbcType=VARCHAR},
language = #{language,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER}, delete_flag = #{deleteFlag,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=INTEGER}, created_id = #{createdId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP}, created_time = #{createdTime,jdbcType=TIMESTAMP},
......
...@@ -5,6 +5,13 @@ ...@@ -5,6 +5,13 @@
<id column="id" property="id" jdbcType="INTEGER" /> <id column="id" property="id" jdbcType="INTEGER" />
<result column="unionid" property="unionid" jdbcType="VARCHAR" /> <result column="unionid" property="unionid" jdbcType="VARCHAR" />
<result column="openid" property="openid" jdbcType="VARCHAR" /> <result column="openid" property="openid" jdbcType="VARCHAR" />
<result column="nickname" property="nickname" jdbcType="VARCHAR" />
<result column="head_img_url" property="headImgUrl" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="TINYINT" />
<result column="country" property="country" jdbcType="VARCHAR" />
<result column="province" property="province" jdbcType="VARCHAR" />
<result column="city" property="city" jdbcType="VARCHAR" />
<result column="language" property="language" jdbcType="VARCHAR" />
<result column="type" property="type" jdbcType="INTEGER" /> <result column="type" property="type" jdbcType="INTEGER" />
<result column="privilege" property="privilege" jdbcType="VARCHAR" /> <result column="privilege" property="privilege" jdbcType="VARCHAR" />
<result column="subscribe" property="subscribe" jdbcType="INTEGER" /> <result column="subscribe" property="subscribe" jdbcType="INTEGER" />
...@@ -18,33 +25,49 @@ ...@@ -18,33 +25,49 @@
<result column="modified_id" property="modifiedId" jdbcType="INTEGER" /> <result column="modified_id" property="modifiedId" jdbcType="INTEGER" />
<result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP" /> <result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, unionid, openid, type, privilege, subscribe, subscribe_time, remark, groupid, id, unionid, openid, nickname, head_img_url, sex, country, province, city, language,
tagid_list, delete_flag, created_id, created_time, modified_id, modified_time type, privilege, subscribe, subscribe_time, remark, groupid, tagid_list, delete_flag,
created_id, created_time, modified_id, modified_time
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from account_wechat_info from account_wechat_info
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<!--通过UnionId获取微信信息-->
<select id="selectByUnionId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from account_wechat_info
where unionid = #{id}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from account_wechat_info delete from account_wechat_info
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity" > <insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity" >
insert into account_wechat_info (id, unionid, openid, insert into account_wechat_info (id, unionid, openid,
type, privilege, subscribe, nickname, head_img_url, sex,
subscribe_time, remark, groupid, country, province, city,
tagid_list, delete_flag, created_id, language, type, privilege,
created_time, modified_id, modified_time subscribe, subscribe_time, remark,
) groupid, tagid_list, delete_flag,
created_id, created_time, modified_id,
modified_time)
values (#{id,jdbcType=INTEGER}, #{unionid,jdbcType=VARCHAR}, #{openid,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{unionid,jdbcType=VARCHAR}, #{openid,jdbcType=VARCHAR},
#{type,jdbcType=INTEGER}, #{privilege,jdbcType=VARCHAR}, #{subscribe,jdbcType=INTEGER}, #{nickname,jdbcType=VARCHAR}, #{headImgUrl,jdbcType=VARCHAR}, #{sex,jdbcType=TINYINT},
#{subscribeTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{groupid,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR},
#{tagidList,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER}, #{language,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{privilege,jdbcType=VARCHAR},
#{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP} #{subscribe,jdbcType=INTEGER}, #{subscribeTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR},
) #{groupid,jdbcType=VARCHAR}, #{tagidList,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER},
#{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER},
#{modifiedTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity" > <insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.AccountWeChatInfoEntity" >
insert into account_wechat_info insert into account_wechat_info
...@@ -58,6 +81,27 @@ ...@@ -58,6 +81,27 @@
<if test="openid != null" > <if test="openid != null" >
openid, openid,
</if> </if>
<if test="nickname != null" >
nickname,
</if>
<if test="headImgUrl != null" >
head_img_url,
</if>
<if test="sex != null" >
sex,
</if>
<if test="country != null" >
country,
</if>
<if test="province != null" >
province,
</if>
<if test="city != null" >
city,
</if>
<if test="language != null" >
language,
</if>
<if test="type != null" > <if test="type != null" >
type, type,
</if> </if>
...@@ -105,6 +149,27 @@ ...@@ -105,6 +149,27 @@
<if test="openid != null" > <if test="openid != null" >
#{openid,jdbcType=VARCHAR}, #{openid,jdbcType=VARCHAR},
</if> </if>
<if test="nickname != null" >
#{nickname,jdbcType=VARCHAR},
</if>
<if test="headImgUrl != null" >
#{headImgUrl,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
#{sex,jdbcType=TINYINT},
</if>
<if test="country != null" >
#{country,jdbcType=VARCHAR},
</if>
<if test="province != null" >
#{province,jdbcType=VARCHAR},
</if>
<if test="city != null" >
#{city,jdbcType=VARCHAR},
</if>
<if test="language != null" >
#{language,jdbcType=VARCHAR},
</if>
<if test="type != null" > <if test="type != null" >
#{type,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
</if> </if>
...@@ -152,6 +217,27 @@ ...@@ -152,6 +217,27 @@
<if test="openid != null" > <if test="openid != null" >
openid = #{openid,jdbcType=VARCHAR}, openid = #{openid,jdbcType=VARCHAR},
</if> </if>
<if test="nickname != null" >
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="headImgUrl != null" >
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
sex = #{sex,jdbcType=TINYINT},
</if>
<if test="country != null" >
country = #{country,jdbcType=VARCHAR},
</if>
<if test="province != null" >
province = #{province,jdbcType=VARCHAR},
</if>
<if test="city != null" >
city = #{city,jdbcType=VARCHAR},
</if>
<if test="language != null" >
language = #{language,jdbcType=VARCHAR},
</if>
<if test="type != null" > <if test="type != null" >
type = #{type,jdbcType=INTEGER}, type = #{type,jdbcType=INTEGER},
</if> </if>
...@@ -195,6 +281,13 @@ ...@@ -195,6 +281,13 @@
update account_wechat_info update account_wechat_info
set unionid = #{unionid,jdbcType=VARCHAR}, set unionid = #{unionid,jdbcType=VARCHAR},
openid = #{openid,jdbcType=VARCHAR}, openid = #{openid,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
head_img_url = #{headImgUrl,jdbcType=VARCHAR},
sex = #{sex,jdbcType=TINYINT},
country = #{country,jdbcType=VARCHAR},
province = #{province,jdbcType=VARCHAR},
city = #{city,jdbcType=VARCHAR},
language = #{language,jdbcType=VARCHAR},
type = #{type,jdbcType=INTEGER}, type = #{type,jdbcType=INTEGER},
privilege = #{privilege,jdbcType=VARCHAR}, privilege = #{privilege,jdbcType=VARCHAR},
subscribe = #{subscribe,jdbcType=INTEGER}, subscribe = #{subscribe,jdbcType=INTEGER},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册