package com.org.hktshop.controller.Admin;

import com.org.hktshop.Interface.admin.IHktAdminLogService;
import com.org.hktshop.base.BaseResult;
import com.org.hktshop.controller.BaseController;

import com.org.hktshop.entity.admin.HktAdminLog;
import com.org.hktshop.utils.HttpCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@Api(value = "操作日志api")
public class HktLogController extends BaseController {

    @Autowired
    IHktAdminLogService logService;

    @PostMapping("/async/admin/queryLogs")
    @ApiOperation(value = "查询日志", notes = "查询日志")
    public Object queryAdmins(@RequestBody HktAdminLog in_log, HttpServletRequest request) {
        try {
            List<HktAdminLog> resources = logService.queryList(in_log);
            return BaseResult.successWithData(resources);
        } catch (Exception ex) {
            return BaseResult.fail(HttpCode.INTERNAL_SERVER_ERROR.getCode());
        }
    }
}
