OperateLogController.java 2.1 KB
Newer Older
苗卫卫 committed
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
package com.boco.nbd.wios.manage.controller;

import com.boco.nbd.wios.manage.entity.bo.OperateLog;
import com.boco.nbd.wios.manage.entity.bo.OperateLogBo;
import com.boco.nbd.wios.manage.entity.cams.enums.OperateLogType;
import com.boco.nbd.wios.manage.service.impl.OperateLogService;
import com.ihidea.component.api.v2.BaseResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 操作日志接口
 * 
 * @author xgl
 * @version [版本号, 2020年9月29日]
 */
@RestController
@RequestMapping("api")
@Api(tags = "操作日志接口")
public class OperateLogController {

    @Autowired
    OperateLogService opLogService;

    /**
     * 查询列表
     * @param types
     * @param thirdPartyId
     * @return
     */
    @GetMapping(value = "operateLog/list")
    @ApiOperation(value = "查询列表")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "thirdPartyId", value = "第三方id", dataType = "String", paramType = "query", required = false),
        @ApiImplicitParam(name = "types", value = "类型 ", dataType = "int", paramType = "query", required = false),})
    public BaseResponse<List<OperateLog>> list(String types, String thirdPartyId) {
        OperateLogBo condition = new OperateLogBo();
        if (StringUtils.isEmpty(types)) {
            types = OperateLogType.ORDER_STATUS.getType() + "," + OperateLogType.STAFF_CHANGE.getType() + ","
                + OperateLogType.SUPPLIER_CHANGE.getType();
        }
        condition.setTypes(types);
        condition.setThirdPartyId(thirdPartyId);
        List<OperateLog> list = opLogService.getList(condition);
        
        return new BaseResponse<List<OperateLog>>(list);
    }
}