删除接口:更新过期时间

This commit is contained in:
liuchengqian 2023-03-10 08:57:55 +08:00
parent 1e35270762
commit d536b4d84d
4 changed files with 5 additions and 49 deletions

View File

@ -60,7 +60,7 @@ public class SysUserController {
*/
@Transactional(rollbackFor = Exception.class)
@RequestMapping(value = "/updateSysUser", method = RequestMethod.POST)
public String updateSysUser(@RequestBody Map<String, String> paramMap) {
public String updateSysUser(@RequestHeader(value = "Authorization") String token, @RequestBody Map<String, String> paramMap) {
String userIdArray = paramMap.get("userIdArray");
String overTime = paramMap.get("overTime");
String remark = paramMap.get("remark");
@ -395,14 +395,4 @@ public class SysUserController {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "true", locale);
}
/**
* 修改账号到期时间
*/
@PostMapping("/updateOverTime")
public String updateOverTime(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
Long userId = (Long) map.get("userId");
String overTime = (String) map.get("overTime");
return sysUserService.updateOverTime(userId, overTime);
}
}

View File

@ -76,13 +76,6 @@ public interface SysUserDao extends JpaRepository<SysUserEntity, Long>, JpaSpeci
@Query(value = "select * from sys_user where id = ?", nativeQuery = true)
SysUserEntity selectByUserId(Long userId);
/**
* 根据id修改账户的到期时间
*/
@Query(value = "update sys_user set over_time = ?2 where id = ?1", nativeQuery = true)
@Modifying(clearAutomatically = true)
void updateOverTime(Long userId, String overTime);
/**
* 记录用户登录次数
*/

View File

@ -1,7 +1,7 @@
package com.xkrs.service;
import com.xkrs.model.qo.SysUserQo;
import com.xkrs.model.entity.SysUserEntity;
import com.xkrs.model.qo.SysUserQo;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@ -109,15 +109,6 @@ public interface SysUserService {
*/
SysUserEntity getUserByUserName(String userName);
/**
* 修改账号到期时间
*
* @param userId
* @param overTime
* @return
*/
String updateOverTime(Long userId, String overTime);
/**
* 记录用户登录次数
*

View File

@ -1,18 +1,10 @@
package com.xkrs.service.impl;
import com.xkrs.common.encapsulation.PromptMessageEnum;
import com.xkrs.dao.StreetDao;
import com.xkrs.model.entity.StreetEntity;
import com.xkrs.dao.*;
import com.xkrs.model.entity.*;
import com.xkrs.model.qo.SysUserQo;
import com.xkrs.service.RedisService;
import com.xkrs.dao.RelRoleAuthorityDao;
import com.xkrs.dao.RelUserRoleDao;
import com.xkrs.dao.SysRoleDao;
import com.xkrs.dao.SysUserDao;
import com.xkrs.model.entity.RelRoleAuthorityEntity;
import com.xkrs.model.entity.RelUserRoleEntity;
import com.xkrs.model.entity.SysRoleEntity;
import com.xkrs.model.entity.SysUserEntity;
import com.xkrs.service.SysUserService;
import com.xkrs.utilsnew.VipTimeRangeUtils;
import org.apache.http.util.TextUtils;
@ -32,8 +24,8 @@ import java.util.List;
import java.util.Locale;
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
import static com.xkrs.utilsold.DateTimeUtil.dateTimeToString;
import static com.xkrs.utilsnew.EncryptDecryptUtil.encry256;
import static com.xkrs.utilsold.DateTimeUtil.dateTimeToString;
/**
* 系统用户服务实现
@ -302,16 +294,6 @@ public class SysUserServiceImpl implements SysUserService {
return sysUserEntityList.get(0);
}
/**
* 修改账号到期时间
*/
@Transactional(rollbackFor = Exception.class)
@Override
public String updateOverTime(Long userId, String overTime) {
sysUserDao.updateOverTime(userId, overTime);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale);
}
/**
* 记录用户登录次数
*/