ludc
2023-03-22 e0652e168a1ad4a831d59d54363d3fa5582903d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package org.springblade.system.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.UserPwdstrategy;
import org.springblade.system.mapper.UserPwdstrategyMapper;
import org.springblade.system.service.IUserPwdstrategyService;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
 
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
 
/**
 * 用户密码策略管理表(UserPwdstrategy)表服务实现类
 *
 * @author makejava
 * @since 2023-03-22 15:24:55
 */
@Service
public class UserPwdstrategyServiceImpl extends ServiceImpl<UserPwdstrategyMapper,UserPwdstrategy> implements IUserPwdstrategyService {
 
    @Resource
    private UserPwdstrategyMapper userPwdstrategyMapper;
 
    /**
     * 新增数据
     *
     * @param userPwdstrategy 实例对象
     * @return 实例对象
     */
    @Override
    public boolean submit(UserPwdstrategy userPwdstrategy) {
        if(Func.isEmpty(userPwdstrategy.getId())){
            return this.saveOrUpdate(userPwdstrategy);
        }else {
            CacheUtil.clear(SYS_CACHE,Boolean.FALSE);
            return this.saveOrUpdate(userPwdstrategy);
        }
    }
 
}