| | |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.ctuser.dao.mapper.CtUsepostMapper; |
| | | import cn.huge.module.ctuser.domain.po.CtUsepost; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | public void saveCtUsepost(CtUsepost ctUsepost){ |
| | | try{ |
| | | Date nowDate = DateUtils.getMowDate(); |
| | | Date nowDate = DateUtils.getNowDate(); |
| | | // 判断是否新增 |
| | | if (IdUtils.checkNewId(ctUsepost.getId())){ |
| | | ctUsepost.setId(utilsClient.getNewTimeId()); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据用户编号物理删除 |
| | | * @param userId 用户编号 |
| | | */ |
| | | public void deleteByUserId(String userId){ |
| | | try{ |
| | | QueryWrapper<CtUsepost> ctUseroleQueryWrapper = new QueryWrapper<>(); |
| | | ctUseroleQueryWrapper.eq("user_id", userId); |
| | | mapper.delete(ctUseroleQueryWrapper); |
| | | }catch (Exception e){ |
| | | log.error("[CtUsepostService.deleteByUserId]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("CtUsepostService.deleteByUserId", e); |
| | | } |
| | | } |
| | | |
| | | } |