提交修改
This commit is contained in:
parent
14b6750a21
commit
2d8e53efc0
@ -16,11 +16,16 @@ public class BuyerDTO {
|
||||
*/
|
||||
private String buyerName;
|
||||
|
||||
/***
|
||||
* 是否是测试用户 1 ,是测试用户, 0 是正常用户
|
||||
*/
|
||||
private Integer isTest;
|
||||
|
||||
/***
|
||||
* 是否是测试用户 1 ,是测试用户, 2 是匿名用户 , 0 是正常用户
|
||||
* 登录类型 1 真实登录,0 假登录
|
||||
*/
|
||||
private Integer flag;
|
||||
private Integer loginType;
|
||||
|
||||
|
||||
/***
|
||||
* token
|
||||
@ -33,67 +38,9 @@ public class BuyerDTO {
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
|
||||
|
||||
//买家微信
|
||||
private String buyerWeixin;
|
||||
//买家手机号
|
||||
private String buyerPhone;
|
||||
|
||||
|
||||
public Long getBuyerId() {
|
||||
return buyerId;
|
||||
}
|
||||
|
||||
public void setBuyerId(Long buyerId) {
|
||||
this.buyerId = buyerId;
|
||||
}
|
||||
|
||||
public String getBuyerName() {
|
||||
return buyerName;
|
||||
}
|
||||
|
||||
public void setBuyerName(String buyerName) {
|
||||
this.buyerName = buyerName;
|
||||
}
|
||||
|
||||
public Integer getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(Integer flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getBuyerWeixin() {
|
||||
return buyerWeixin;
|
||||
}
|
||||
|
||||
public void setBuyerWeixin(String buyerWeixin) {
|
||||
this.buyerWeixin = buyerWeixin;
|
||||
}
|
||||
|
||||
public String getBuyerPhone() {
|
||||
return buyerPhone;
|
||||
}
|
||||
|
||||
public void setBuyerPhone(String buyerPhone) {
|
||||
this.buyerPhone = buyerPhone;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package com.heyu.api.data.entity.vv;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.lz.mybatis.plugin.annotations.AS;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;import java.util.Date;
|
||||
import java.util.Date;
|
||||
/**
|
||||
*买家信息
|
||||
* @author quyixiao
|
||||
@ -63,7 +63,7 @@ private static final long serialVersionUID = 1L;
|
||||
private Long createTimestamp;
|
||||
//买家修改时间
|
||||
private Long modifyTimestamp;
|
||||
//是否是测试账号
|
||||
//是否是测试账号,1 测试账号, 0 非测试账号
|
||||
private Integer isTest;
|
||||
//微信头像
|
||||
private String avatar;
|
||||
|
||||
@ -35,6 +35,8 @@ public class R<T> {
|
||||
*/
|
||||
private String traceId;
|
||||
|
||||
// code = 288 模拟登录
|
||||
// code = 289 真实登录
|
||||
public R() {
|
||||
this.code = RespCode.SUCCESS.code;
|
||||
this.msg = RespCode.SUCCESS.msg;
|
||||
|
||||
@ -89,9 +89,6 @@ public class LLMUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* https://heyuoss.oss-cn-shanghai.aliyuncs.com/test/ccc.jpg
|
||||
*/
|
||||
|
||||
@ -7,8 +7,6 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VvAnonymousUserLoginRequest extends AppBaseRequest {
|
||||
|
||||
|
||||
/***
|
||||
* 设备id
|
||||
*
|
||||
@ -22,6 +20,7 @@ public class VvAnonymousUserLoginRequest extends AppBaseRequest {
|
||||
private String deviceId;
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
String password = "qhzhixing";
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
package com.heyu.api.alibaba.request.vv;
|
||||
|
||||
|
||||
import com.heyu.api.data.service.impl.AppBaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppCreatePromoterCodeRequest extends AppBaseRequest {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.heyu.api.alibaba.request.vv;
|
||||
|
||||
|
||||
import com.heyu.api.data.service.impl.AppBaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppCreatePromoterLinkRequest extends AppBaseRequest {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.heyu.api.alibaba.request.vv;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.heyu.api.data.service.impl.AppBaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppParsePromoterRequest extends AppBaseRequest {
|
||||
|
||||
|
||||
|
||||
|
||||
private String promoterCode;
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
AppParsePromoterRequest app = new AppParsePromoterRequest();
|
||||
app.setPromoterCode("123456");
|
||||
System.out.println(JSON.toJSONString(app));
|
||||
}
|
||||
|
||||
}
|
||||
@ -5,9 +5,10 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppUserLoginRequest extends AppBaseRequest {
|
||||
|
||||
/***
|
||||
* 微信code
|
||||
*/
|
||||
private String code;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package com.heyu.api.alibaba.request.vv.resp;
|
||||
|
||||
|
||||
import com.heyu.api.data.service.impl.AppBaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppCreatePromoterCodeResp extends AppBaseRequest {
|
||||
|
||||
|
||||
/***
|
||||
* 推广码
|
||||
*/
|
||||
private String promoterCode;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.heyu.api.alibaba.request.vv.resp;
|
||||
|
||||
|
||||
import com.heyu.api.data.service.impl.AppBaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppCreatePromoterLinkResp extends AppBaseRequest {
|
||||
|
||||
|
||||
/***
|
||||
* 推广链接
|
||||
*/
|
||||
private String promoterLink;
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.heyu.api.alibaba.request.vv.resp;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppParsePromoterResp {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
|
||||
package com.heyu.api.controller.vv;
|
||||
|
||||
|
||||
import com.heyu.api.alibaba.request.vv.AppCreatePromoterCodeRequest;
|
||||
import com.heyu.api.alibaba.request.vv.AppCreatePromoterLinkRequest;
|
||||
import com.heyu.api.alibaba.request.vv.AppParsePromoterRequest;
|
||||
import com.heyu.api.alibaba.request.vv.resp.AppCreatePromoterCodeResp;
|
||||
import com.heyu.api.alibaba.request.vv.resp.AppCreatePromoterLinkResp;
|
||||
import com.heyu.api.common.annotation.AppLogin;
|
||||
import com.heyu.api.common.annotation.Describe;
|
||||
import com.heyu.api.data.dao.vv.VvPromoterBuyerDao;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/app")
|
||||
@AppLogin
|
||||
public class AppPromoterController {
|
||||
|
||||
@Autowired
|
||||
private VvPromoterBuyerDao vvPromoterBuyerDao;
|
||||
|
||||
/***
|
||||
* 列表
|
||||
* http://localhost:8888/app/create/promoter/code
|
||||
*/
|
||||
@Describe("创建推广码")
|
||||
@RequestMapping("/create/promoter/code")
|
||||
public R promoterCode(@RequestBody AppCreatePromoterCodeRequest request) {
|
||||
|
||||
|
||||
AppCreatePromoterCodeResp promoterCodeResp = new AppCreatePromoterCodeResp();
|
||||
|
||||
promoterCodeResp.setPromoterCode("1111111111111");
|
||||
return R.ok().setData(promoterCodeResp);
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
* 列表
|
||||
* http://localhost:8888/app/create/promoter/link
|
||||
*/
|
||||
@Describe("创建推广链接")
|
||||
@RequestMapping("/create/promoter/link")
|
||||
public R promoterlink(@RequestBody AppCreatePromoterLinkRequest request) {
|
||||
|
||||
AppCreatePromoterLinkResp promoterLinkResp = new AppCreatePromoterLinkResp();
|
||||
|
||||
promoterLinkResp.setPromoterLink("1111111111111");
|
||||
return R.ok().setData(promoterLinkResp);
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 列表
|
||||
* http://localhost:8888/app/parse/promoter/code
|
||||
*/
|
||||
@Describe("创建推广链接")
|
||||
@RequestMapping("/parse/promoter/code")
|
||||
public R parsePromoterCode(@RequestBody AppParsePromoterRequest request) {
|
||||
|
||||
return R.ok();
|
||||
|
||||
}
|
||||
}
|
||||
@ -49,6 +49,7 @@ public class AppUserLoginController {
|
||||
if (weiChatLoginDTO == null) {
|
||||
return R.error("code 失效");
|
||||
}
|
||||
|
||||
VvBuyerEntity target = vvBuyerDao.selectVvBuyerOpenId(weiChatLoginDTO.getOpenid());
|
||||
if (target == null) {
|
||||
target = new VvBuyerEntity();
|
||||
@ -56,25 +57,20 @@ public class AppUserLoginController {
|
||||
target.setIsTest(0);
|
||||
target.setCreateTimestamp(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
target.setSessionKey(weiChatLoginDTO.getSessionKey());
|
||||
|
||||
vvBuyerDao.insertOrUpdateVvBuyer(target);
|
||||
|
||||
// 默认24 小时
|
||||
BuyerDTO buyerDTO = buildBuyerLoginInfoCacheRedisDB(target, RedisUtils.DEFAULT_EXPIRE, null);
|
||||
replaceActivityInfo(request, "/app/user/login");
|
||||
return R.ok().put("buyer", buyerDTO);
|
||||
}
|
||||
|
||||
|
||||
// http://localhost:8888/app/user/anonymous/login
|
||||
@RequestMapping("/anonymous/login")
|
||||
@Describe("匿名用户登录")
|
||||
public R anonymousLogin(@RequestBody VvAnonymousUserLoginRequest request) {
|
||||
String deviceId = request.getDeviceId();
|
||||
String value = AesUtil.decrypt(deviceId, ApiConstants.AnonymousUserLogin_aes_password);
|
||||
|
||||
if (StringUtils.isBlank(value) || !value.startsWith(ApiConstants.AnonymousUserLogin_pre)) {
|
||||
log.info("AnonymousUserLoginAesPassword anonymous value:{}", JSON.toJSONString(request));
|
||||
return R.error("设备号不对");
|
||||
@ -84,7 +80,6 @@ public class AppUserLoginController {
|
||||
target.setIsTest(UserLoginFlagEnums.anonymous_user.getFlag());
|
||||
target.setId(random.nextLong());
|
||||
BuyerDTO buyerDTO = buildBuyerLoginInfoCacheRedisDB(target, RedisUtils.thirty_minute, request.getDeviceId());
|
||||
|
||||
replaceActivityInfo(request, "/app/user/anonymous/login");
|
||||
return R.ok().put("buyer", buyerDTO);
|
||||
}
|
||||
@ -145,7 +140,7 @@ public class AppUserLoginController {
|
||||
BuyerDTO buyerDTO = new BuyerDTO();
|
||||
buyerDTO.setBuyerId(target.getId());
|
||||
buyerDTO.setBuyerName(target.getBuyerName());
|
||||
buyerDTO.setFlag(target.getIsTest());
|
||||
buyerDTO.setIsTest(target.getIsTest());
|
||||
buyerDTO.setAvatar(target.getAvatar());
|
||||
buyerDTO.setBuyerPhone(target.getBuyerPhone());
|
||||
buyerDTO.setBuyerWeixin(target.getBuyerWeixin());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user