UserLogController.java 2.26 KB
Newer Older
zhangxiaoyan committed
1 2
package common.controller;

manxiaoqiang committed
3
import common.model.User;
zhangxiaoyan committed
4
import common.model.UserLog;
kangxiaoshan committed
5
import common.service.ContractService;
zhangxiaoyan committed
6
import common.service.UserLogService;
kangxiaoshan committed
7
import dic.AuthMenuEnmm;
zhangxiaoyan committed
8 9
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
kangxiaoshan committed
10
import org.springframework.web.bind.annotation.*;
kangxiaoshan committed
11
import security.annotation.AuthKey;
manxiaoqiang committed
12
import security.annotation.CurrentAccount;
zhangxiaoyan committed
13 14
import util.ResultModel;

kangxiaoshan committed
15
import javax.servlet.http.HttpServletRequest;
zhangxiaoyan committed
16 17 18 19 20 21
import java.util.List;

/**
 * Created by zxy on 2017/12/27.
 */
@Controller
manxiaoqiang committed
22
@RequestMapping(value = "system/userlog")
zhangxiaoyan committed
23 24 25 26
public class UserLogController
{
    @Autowired UserLogService userLogService;

kangxiaoshan committed
27 28 29
    @Autowired
    private ContractService service;

zhangxiaoyan committed
30 31 32
    ///api/userlog/list?startDate=2017-12-26&endDate=2017-12-27
    @RequestMapping(value = "list", method = RequestMethod.GET)
    @ResponseBody
manxiaoqiang committed
33 34
    public ResultModel findByDS(@CurrentAccount User user, @RequestParam String startDate, @RequestParam String endDate) {
        return ResultModel.OK(userLogService.findUserLog(user,startDate, endDate));
zhangxiaoyan committed
35
    }
kangxiaoshan committed
36 37 38 39 40



    @RequestMapping(value = "change/del/info", method = RequestMethod.GET)
    @ResponseBody
kangxiaoshan committed
41
    @AuthKey(AuthMenuEnmm.USERLOGS_V)
kangxiaoshan committed
42
    public ResultModel getChangeDelData( @CurrentAccount User loginAccount,
kangxiaoshan committed
43
                                        HttpServletRequest request,
kangxiaoshan committed
44
                                        String contranctCode,String startDate,String  endDate) {
kangxiaoshan committed
45

kangxiaoshan committed
46
        return ResultModel.OK(service.getChangeDelData(loginAccount,contranctCode,startDate,endDate));
kangxiaoshan committed
47 48 49 50
    }

    @RequestMapping(value = "change/del/detail", method = RequestMethod.GET)
    @ResponseBody
kangxiaoshan committed
51
    public ResultModel getChangeDelDetail( @CurrentAccount User loginAccount,
kangxiaoshan committed
52 53
                                           String pid) {

kangxiaoshan committed
54
        return ResultModel.OK(service.getChangeDelDetailData(loginAccount,pid));
kangxiaoshan committed
55 56
    }

kangxiaoshan committed
57 58
    @RequestMapping(value = "change/del/recover", method = RequestMethod.GET)
    @ResponseBody
kangxiaoshan committed
59
    @AuthKey(AuthMenuEnmm.USERLOGS_RE)
kangxiaoshan committed
60
    public ResultModel changesDelRecover( @CurrentAccount User loginAccount,
kangxiaoshan committed
61 62
                                          HttpServletRequest request,String id,String type) {

kangxiaoshan committed
63
        return ResultModel.OK(service.changesDelRecover(id,type,loginAccount));
kangxiaoshan committed
64 65

    }
zhangxiaoyan committed
66
}