Commit bb6eaebd authored by hezhen's avatar hezhen

123

parent ffcca0c8
......@@ -12,6 +12,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -46,6 +47,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
@Value("${temamember.failureTime:60}")
private Long failureTime;
@Autowired
private AppUserDetailBiz appUserDetailBiz;
/**
* 关系绑定
* @param userId
......@@ -76,6 +80,23 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
}
}
}
//首页关系绑定
public ObjectRestResponse appBindRelation(Integer userId,String code){
Integer parentId=0;
if (StringUtils.isNotBlank(code)){
//判断处理活动关键字
String[] codes = code.split("_");
if(codes.length > 1) {
code = codes[0];
}
parentId=appUserDetailBiz.getUserByCode(code);
}
if (parentId!=null&&parentId>0&&userId!=null&&userId>0){
getMyBiz().bindRelation(userId,parentId,1);
}
return ObjectRestResponse.succ();
}
//永久稳定关系
public void foreverBind(Integer user_id ){
AppUserRelation relation=getMyBiz().getRelationByUserId(user_id);
......
......@@ -9,12 +9,14 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.admin.biz.AppUserRelationBiz;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashSet;
@RestController
@RequestMapping("relation")
......@@ -37,7 +39,20 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
return baseBiz.shareParentByUserId(userid,pid,platform_userid);
}
@ApiOperation("查询邀请的成员")
@RequestMapping(value = "/bind",method = RequestMethod.POST)
@ApiModelProperty("app分享绑定")
public ObjectRestResponse bind(
@RequestParam(value = "code",defaultValue = "")String code,
HttpServletRequest request){
try {
Integer userid = Integer.parseInt(userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId());
return baseBiz.appBindRelation(userid,code);
} catch (Exception e) {
throw new BaseException(e);
}
}
@ApiOperation("查询邀请的成员")
@GetMapping("/pages")
public ObjectRestResponse<InviteMemberVo> findInviteMemberByActivitState(@RequestParam(value = "state",required = false) Integer state,
@RequestParam("page") Integer page,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment