|
@@ -168,6 +168,29 @@ public class FamilyController extends AppBaseController {
|
|
memberVo.setFamilyId(familyId);
|
|
memberVo.setFamilyId(familyId);
|
|
return familyService.applyFamily(memberVo);
|
|
return familyService.applyFamily(memberVo);
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 扫码申请加入家族
|
|
|
|
+ * @param code
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("扫码申请加入家族")
|
|
|
|
+ @ApiImplicitParam(name = "code", value = "申请的家族二维码",paramType="String")
|
|
|
|
+ @GetMapping("/scan")
|
|
|
|
+ public AjaxResult scan(String code) {
|
|
|
|
+ if (StringUtils.isBlank(code)) {
|
|
|
|
+ return AjaxResult.error("二维码为空");
|
|
|
|
+ }
|
|
|
|
+ AppMemberVo memberVo = getLoginUser().getUser();
|
|
|
|
+ TbFamily family = familyService.getOne(new LambdaQueryWrapper<TbFamily>()
|
|
|
|
+ .eq(TbFamily::getCode,code)
|
|
|
|
+ .last("limit 1")
|
|
|
|
+ );
|
|
|
|
+ if (family == null){
|
|
|
|
+ return AjaxResult.error("家族不存在");
|
|
|
|
+ }
|
|
|
|
+ memberVo.setFamilyId(family.getId());
|
|
|
|
+ return familyService.applyFamily(memberVo);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
@ApiOperation("申请列表")
|
|
@ApiOperation("申请列表")
|