root лет назад: 5
Родитель
Сommit
a122bf85f7

+ 34 - 1
.gitignore

1
<<<<<<< HEAD
1
# Compiled class file
2
# Compiled class file
2
*.class
3
*.class
3
target
4
target
29
.classpath
30
.classpath
30
.settings
31
.settings
31
.project
32
.project
32
src/main/resources/application-dev.yml
33
=======
34
# Compiled class file
35
*.class
36
target
37
.settings
38
39
# Log file
40
*.log
41
42
# BlueJ files
43
*.ctxt
44
45
# Mobile Tools for Java (J2ME)
46
.mtj.tmp/
47
48
# Package Files #
49
*.jar
50
*.war
51
*.ear
52
*.zip
53
*.tar.gz
54
*.rar
55
*.iml
56
.idea
57
.vscode
58
59
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
60
hs_err_pid*
61
.factorypath
62
.classpath
63
.settings
64
.project
65
src/main/resources/application-dev.yml

+ 5 - 4
src/main/java/io/renren/modules/admin/member/controller/MemberController.java

2
2
3
import java.util.Arrays;
3
import java.util.Arrays;
4
import java.util.Map;
4
import java.util.Map;
5
import java.util.Date;
5
6
6
import org.apache.shiro.authz.annotation.RequiresPermissions;
7
import org.apache.shiro.authz.annotation.RequiresPermissions;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.beans.factory.annotation.Autowired;
85
    @ApiOperation("修改")
86
    @ApiOperation("修改")
86
    public R update(@RequestBody MemberEntity member){
87
    public R update(@RequestBody MemberEntity member){
87
        ValidatorUtils.validateEntity(member, UpdateGroup.class);
88
        ValidatorUtils.validateEntity(member, UpdateGroup.class);
89
        member.setModifyTime(new Date());
88
        member.setModifyId(getUserId());
90
        member.setModifyId(getUserId());
89
		memberService.updateById(member);
91
		memberService.updateById(member);
90
92
106
    @RequiresPermissions("admin:member:delete")
108
    @RequiresPermissions("admin:member:delete")
107
    @ApiOperation("删除")
109
    @ApiOperation("删除")
108
    public R delete(@RequestBody Long[] ids){
110
    public R delete(@RequestBody Long[] ids){
109
        // memberService.removeByIds(Arrays.asList(ids));
110
        memberService.delete(ids);
111
        memberService.delete(ids);
111
        return R.ok();
112
        return R.ok();
112
    }
113
    }
118
        // memberService.removeByIds(Arrays.asList(ids));
119
        // memberService.removeByIds(Arrays.asList(ids));
119
        Long id = Long.valueOf(param.get("id").toString());
120
        Long id = Long.valueOf(param.get("id").toString());
120
        Integer status = Integer.valueOf(param.get("status").toString());
121
        Integer status = Integer.valueOf(param.get("status").toString());
121
        System.out.println(id);
122
        System.out.println(status);
123
        int it = memberService.updateStatus(id, status);
122
        // System.out.println(id);
123
        // System.out.println(status);
124
        memberService.updateStatus(id, status);
124
        return R.ok();
125
        return R.ok();
125
    }
126
    }
126
}
127
}

+ 1 - 1
src/main/java/io/renren/modules/admin/member/entity/MemberEntity.java

33
	/**
33
	/**
34
	 * 用户名
34
	 * 用户名
35
	 */
35
	 */
36
	@NotBlank(message="用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
36
	@NotBlank(message="用户名不能为空", groups = AddGroup.class)
37
	private String username;
37
	private String username;
38
	/**
38
	/**
39
	 * 密码
39
	 * 密码

+ 5 - 5
src/main/java/io/renren/modules/admin/member/service/impl/MemberServiceImpl.java

29
29
30
    @Override
30
    @Override
31
    public PageUtils queryPage(Map<String, Object> params) {
31
    public PageUtils queryPage(Map<String, Object> params) {
32
        String username = (String)params.get("username");
33
        String truename = (String)params.get("truename");
32
        String key = (String)params.get("key");
34
        // System.out.println(key);
33
        // System.out.println(key);
35
        IPage<MemberEntity> page = this.page(
34
        IPage<MemberEntity> page = this.page(
36
                new Query<MemberEntity>().getPage(params),
35
                new Query<MemberEntity>().getPage(params),
37
                new QueryWrapper<MemberEntity>()
36
                new QueryWrapper<MemberEntity>()
38
                .like(StringUtils.isNotBlank(username),"username", username)
37
                .like(StringUtils.isNotBlank(key),"username", key)
39
                .or()
38
                .or()
40
                .like(StringUtils.isNotBlank(truename),"truename", truename)
39
                .like(StringUtils.isNotBlank(key),"truename", key)
41
        );
40
        );
42
41
43
        return new PageUtils(page);
42
        return new PageUtils(page);
57
    @Override
56
    @Override
58
	@Transactional
57
	@Transactional
59
    public void update(MemberEntity member) {
58
    public void update(MemberEntity member) {
60
        member.setModifyTime(new Date());
59
        
60
        member.setUsername(null);
61
        if(StringUtils.isBlank(member.getPassword())){
61
        if(StringUtils.isBlank(member.getPassword())){
62
			member.setPassword(null);
62
			member.setPassword(null);
63
		}else{
63
		}else{