Helius
2021-04-23 9beb428f807920b0dd646edbed822313c47961c6
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.xcong.excoin.modules.agent.controller;
 
import com.xcong.excoin.common.entity.FebsConstant;
import com.xcong.excoin.common.utils.FebsUtil;
import com.xcong.excoin.system.entity.User;
import com.xcong.excoin.system.service.IUserService;
import lombok.RequiredArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
 
/**
 * @author wzy
 * @date 2020-06-10
 **/
@Controller("memberView")
@RequestMapping(FebsConstant.VIEW_PREFIX + "/agent")
@RequiredArgsConstructor
public class ViewController {
 
    private final IUserService userService;
 
    /**
     * 数据总览
     * @return
     */
    @GetMapping("allMemberData")
    @RequiresPermissions("allMemberData:view")
    public String allMemberData() {
        return FebsUtil.view("modules/contract/total-data");
    }
 
    @GetMapping("member")
    @RequiresPermissions("amember:view")
    public String member() {
        return FebsUtil.view("modules/agent/member");
    }
 
    @GetMapping("agent")
    @RequiresPermissions("agent:view")
    public String agent() {
        return FebsUtil.view("modules/agent/agent");
    }
 
    @GetMapping("agentAdd")
    @RequiresPermissions("agent:add")
    public String agentAdd() {
        return FebsUtil.view("modules/agent/agentAdd");
    }
 
    @GetMapping("agentEdit/{id}")
    @RequiresPermissions("agent:edit")
    public String agentEdit(@PathVariable Long id, Model model) {
        User user = userService.findUserInfoById(id);
        model.addAttribute("user", user);
        return FebsUtil.view("modules/agent/agentEdit");
    }
}