提交 979208a8 作者: 余乾开

Merge branch 'develop'

......@@ -22,4 +22,12 @@ public class AppUserSucVO implements Serializable {
private Integer userAccountId;
@ApiModelProperty(value = "token")
private String token;
@ApiModelProperty(value = "UID")
private String uid;
@ApiModelProperty(value = "手机号")
private String phoneNum;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "sessionKey")
private String sessionKey;
}
......@@ -21,7 +21,6 @@ import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = "com.mmc.iuav.user.model.vo.UserAccountVO", description = "用户信息")
public class UserAccountVO implements Serializable {
private static final long serialVersionUID = 7067111726018678883L;
@ApiModelProperty(value = "用户id")
......
......@@ -18,7 +18,6 @@ import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.iuav.user.model.vo.WxLoginVO", description = "登录参数")
public class WxLoginVO implements Serializable {
private static final long serialVersionUID = 2500957724470423989L;
@ApiModelProperty(value = "请求code")
......
......@@ -33,8 +33,8 @@ public class UserAccountController {
@ApiOperation(value = "获取用户信息")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountVO.class) })
@GetMapping("info")
public UserAccountVO info(@RequestParam Integer userAccountId){
return userAccountService.getUserAccountById(userAccountId);
public ResultBody info(@RequestParam Integer userAccountId){
return ResultBody.success(userAccountService.getUserAccountById(userAccountId));
}
@ApiOperation(value = "修改用户信息")
......@@ -44,14 +44,14 @@ public class UserAccountController {
return userAccountService.update(userAccountVO);
}
@ApiOperation(value = "获取用户基本信息")
@ApiOperation(value = "获取用户基本信息", hidden = true)
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountSimpleDTO.class) })
@GetMapping("feignGetUserSimpleInfo")
public UserAccountSimpleDTO feignGetUserSimpleInfo(@RequestParam Integer userAccountId){
return userAccountService.getUserSimpleInfo(userAccountId);
}
@ApiOperation(value = "根据用户地区查询后台用户id")
@ApiOperation(value = "根据用户地区查询后台用户id", hidden = true)
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountSimpleDTO.class) })
@GetMapping("feignListUserAccountIds")
public List<Integer>feignListUserAccountIds(@RequestParam Integer provinceCode, @RequestParam(required = false) Integer cityCode, @RequestParam(required = false) Integer districtCode){
......
......@@ -20,4 +20,10 @@ public interface WxService {
* @return
*/
String pcLogin(WxLoginVO wxLoginVO);
/**
* 获取AccessToken
* @return
*/
String getAccessToken();
}
......@@ -40,6 +40,7 @@ public class AuthServiceImpl implements AuthService {
public ResultBody appletLogin(WxLoginVO wxLoginVO) {
String unionId;
String openId;
String sessionKey;
if (wxLoginVO.getFromPort().toString().equals(WxConstant.APP.toString())) {
//调用小程序登录接口,里面包含unionId
String appWxJson = wxService.appLogin(wxLoginVO);
......@@ -54,6 +55,7 @@ public class AuthServiceImpl implements AuthService {
}
unionId = json.getString(WxConstant.UNION_ID);
openId = json.getString(WxConstant.OPEN_ID);
sessionKey = json.getString(WxConstant.SESSION_KEY);
}else if (wxLoginVO.getFromPort().equals(WxConstant.WEB)){
//获取access_token接口,里面包含unionId
String pcWxJson = wxService.pcLogin(wxLoginVO);
......@@ -68,6 +70,7 @@ public class AuthServiceImpl implements AuthService {
}
unionId = json.getString(WxConstant.UNION_ID);
openId = json.getString(WxConstant.OPEN_ID);
sessionKey = json.getString(WxConstant.SESSION_KEY);
}else {
return ResultBody.error(ResultEnum.PARAM_ERROR);
}
......@@ -90,6 +93,7 @@ public class AuthServiceImpl implements AuthService {
map.put(JwtConstant.TOKEN_TYPE, JwtConstant.IUAV_TOKEN);
String token = JwtUtil.createJwt(map);
return ResultBody.success(AppUserSucVO.builder().token(token).userAccountId(userAccountVO.getId()).build());
return ResultBody.success(AppUserSucVO.builder().token(token).uid(userAccountVO.getUid()).phoneNum(userAccountVO.getPhoneNum())
.nickName(userAccountVO.getNickName()).userAccountId(userAccountVO.getId()).sessionKey(sessionKey).build());
}
}
......@@ -32,4 +32,10 @@ public class WxServiceImpl implements WxService {
String data = HttpsRequestUtil.httpsGet(url, null);
return data;
}
@Override
public String getAccessToken() {
//token有效期为7200s,需要保存起来
return null;
}
}
......@@ -17,4 +17,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: 85d0adbe8cda52581b8cbb2fb430a91820dff33a
newTag: cf8d6b7a592365bc3d490a400515248b17aead02
......@@ -3,4 +3,4 @@ kind: ConfigMap
metadata:
name: cms-map
data:
SPRING_PROFILES_ACTIVE: dev
\ No newline at end of file
SPRING_PROFILES_ACTIVE: prod
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: cms-deployment
spec:
replicas: 2
\ No newline at end of file
......@@ -9,6 +9,7 @@ commonLabels:
commonAnnotations:
note: This is prod!
patches:
- path: increase_replicas.yaml
- path: configMap.yaml
- path: service-patch.yaml
target:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论