|
@@ -24,8 +24,10 @@ import net.mingsoft.people.action.web.PeopleAction;
|
|
|
import net.mingsoft.people.biz.IPeopleBiz;
|
|
import net.mingsoft.people.biz.IPeopleBiz;
|
|
|
import net.mingsoft.people.entity.PeopleEntity;
|
|
import net.mingsoft.people.entity.PeopleEntity;
|
|
|
import net.mingsoft.tf.biz.IExhibitorBiz;
|
|
import net.mingsoft.tf.biz.IExhibitorBiz;
|
|
|
|
|
+import net.mingsoft.tf.biz.IGuestBiz;
|
|
|
import net.mingsoft.tf.biz.IPeopleExhibitorBiz;
|
|
import net.mingsoft.tf.biz.IPeopleExhibitorBiz;
|
|
|
-import net.mingsoft.tf.entity.PeopleExhibitorEntity;
|
|
|
|
|
|
|
+import net.mingsoft.tf.entity.GuestEntity;
|
|
|
|
|
+import net.mingsoft.tf.wx.dto.GuestRequest;
|
|
|
import net.mingsoft.tf.wx.dto.WxCustomUserNamePasswordToken;
|
|
import net.mingsoft.tf.wx.dto.WxCustomUserNamePasswordToken;
|
|
|
import net.mingsoft.tf.wx.dto.WxRegisterRequest;
|
|
import net.mingsoft.tf.wx.dto.WxRegisterRequest;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -62,6 +64,8 @@ public class WxPeopleAction extends BaseAction {
|
|
|
private IExhibitorBiz exhibitorBiz;
|
|
private IExhibitorBiz exhibitorBiz;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IPeopleExhibitorBiz peopleExhibitorBiz;
|
|
private IPeopleExhibitorBiz peopleExhibitorBiz;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IGuestBiz guestBiz;
|
|
|
@Value("${wx.appid}")
|
|
@Value("${wx.appid}")
|
|
|
private String appid;
|
|
private String appid;
|
|
|
@Value("${wx.secret}")
|
|
@Value("${wx.secret}")
|
|
@@ -78,6 +82,20 @@ public class WxPeopleAction extends BaseAction {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Operation(summary = "微信-游客,可修改信息和关联邀请")
|
|
|
|
|
+ @Parameters({
|
|
|
|
|
+ @Parameter(name = "openid", description = "openid", required = true, in = ParameterIn.QUERY),
|
|
|
|
|
+ @Parameter(name = "icon", description = "头像", in = ParameterIn.QUERY),
|
|
|
|
|
+ @Parameter(name = "nickName", description = "昵称", in = ParameterIn.QUERY),
|
|
|
|
|
+ @Parameter(name = "code", description = "邀请码", in = ParameterIn.QUERY)
|
|
|
|
|
+ })
|
|
|
|
|
+ @PostMapping(value = "/guest")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public ResultData guest(@RequestBody GuestRequest guest) {
|
|
|
|
|
+ guestBiz.updateGuest(guest.getOpenid(), guest.getIcon(), guest.getNickName(), guest.getCode());
|
|
|
|
|
+ return ResultData.build().success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Operation(summary = "微信-登录")
|
|
@Operation(summary = "微信-登录")
|
|
|
@Parameters({
|
|
@Parameters({
|
|
|
@Parameter(name = "code", description = "code", required = true, in = ParameterIn.QUERY)
|
|
@Parameter(name = "code", description = "code", required = true, in = ParameterIn.QUERY)
|
|
@@ -100,12 +118,12 @@ public class WxPeopleAction extends BaseAction {
|
|
|
if (login.isSuccess()) {
|
|
if (login.isSuccess()) {
|
|
|
map.putAll(login.getData(Map.class));
|
|
map.putAll(login.getData(Map.class));
|
|
|
map.put("guest", false);
|
|
map.put("guest", false);
|
|
|
- } else {
|
|
|
|
|
- PeopleExhibitorEntity entity = peopleExhibitorBiz.saveGuest(openid);
|
|
|
|
|
- map.put("puIcon", entity.getIcon());
|
|
|
|
|
- map.put("puNickname", entity.getNickName());
|
|
|
|
|
- map.put("guest", true);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ GuestEntity entity = guestBiz.saveGuest(openid);
|
|
|
|
|
+ map.put("puIcon", entity.getIcon());
|
|
|
|
|
+ map.put("puNickname", entity.getNickName());
|
|
|
|
|
+ map.put("guest", true);
|
|
|
}
|
|
}
|
|
|
return ResultData.build().success(map);
|
|
return ResultData.build().success(map);
|
|
|
})
|
|
})
|
|
@@ -143,9 +161,9 @@ public class WxPeopleAction extends BaseAction {
|
|
|
people.setPeoplePassword(RandomUtil.randomString(8));
|
|
people.setPeoplePassword(RandomUtil.randomString(8));
|
|
|
ResultData register = peopleAction.register(people, request, response);
|
|
ResultData register = peopleAction.register(people, request, response);
|
|
|
if (register.isSuccess()) {
|
|
if (register.isSuccess()) {
|
|
|
- peopleExhibitorBiz.deleteGuest(people.getPeopleName());
|
|
|
|
|
PeopleEntity user = this.peopleBiz.getEntityByUserName(people.getPeopleName());
|
|
PeopleEntity user = this.peopleBiz.getEntityByUserName(people.getPeopleName());
|
|
|
String linkId = user.getId();
|
|
String linkId = user.getId();
|
|
|
|
|
+ guestBiz.deleteGuest(people.getPeopleName(), linkId);
|
|
|
ModelMap modelData = new ExtendedModelMap();
|
|
ModelMap modelData = new ExtendedModelMap();
|
|
|
modelData.put("companyName", people.getCompanyName());
|
|
modelData.put("companyName", people.getCompanyName());
|
|
|
modelData.put("position", people.getPosition());
|
|
modelData.put("position", people.getPosition());
|