删除会员接口

This commit is contained in:
zengtao01
2024-10-11 18:23:22 +08:00
parent 881304a059
commit 374ba73336
4 changed files with 21 additions and 2 deletions

View File

@ -32,7 +32,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -198,6 +200,12 @@ public class MemberUserController {
BeanUtils.toBean(list, MemberUserExportVo.class)); BeanUtils.toBean(list, MemberUserExportVo.class));
} }
@DeleteMapping("/delete/{userId}")
@Operation(summary = "删除会员")
public CommonResult<Boolean> delete(@PathVariable Long userId){
return success(memberUserService.delete(userId));
}
} }

View File

@ -101,8 +101,8 @@ public interface MemberUserMapper extends BaseMapperX<MemberUserDO> {
return update(null, lambdaUpdateWrapper); return update(null, lambdaUpdateWrapper);
} }
@Delete("delete from user_face where user_id = #{faceId}") @Delete("delete from user_face where sys_user_id = #{userId}")
void deleteFace(Long faceId); void deleteFace(@Param("userId") Long userId);
default PageResult<MemberUserDO> selectUserList(MemberUserListVO listVO) { default PageResult<MemberUserDO> selectUserList(MemberUserListVO listVO) {

View File

@ -254,4 +254,7 @@ public interface MemberUserService {
MemberUserDO getByCardId(String cardId); MemberUserDO getByCardId(String cardId);
Map<String,Object> getInfoByCard(String cardId,Long mobile); Map<String,Object> getInfoByCard(String cardId,Long mobile);
boolean delete(Long userId);
} }

View File

@ -884,4 +884,12 @@ public class MemberUserServiceImpl implements MemberUserService {
} }
return BigDecimal.ZERO; return BigDecimal.ZERO;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public boolean delete(Long userId) {
int i = memberUserMapper.deleteById(userId);
memberUserMapper.deleteFace(userId);
return i>0;
}
} }