package com.moral.api.controller; 
 | 
  
 | 
import com.moral.api.entity.SysArea; 
 | 
import com.moral.api.pojo.dto.manageLog.ManageLogQueryDTO; 
 | 
  
 | 
import com.moral.api.pojo.form.manageLog.*; 
 | 
import com.moral.api.pojo.vo.manageLog.*; 
 | 
import com.moral.api.service.ManageLogService; 
 | 
import com.moral.api.service.SysAreaService; 
 | 
  
 | 
import com.moral.constant.ResponseCodeEnum; 
 | 
import com.moral.constant.ResultMessage; 
 | 
import lombok.extern.slf4j.Slf4j; 
 | 
import org.springframework.beans.factory.annotation.Autowired; 
 | 
import org.springframework.web.bind.annotation.*; 
 | 
  
 | 
import java.util.List; 
 | 
  
 | 
  
 | 
/** 
 | 
 * @ClassName SystemController 
 | 
 * @Description TODO 
 | 
 * @Author 陈凯裕 
 | 
 * @Date 2021/4/7 13:17 
 | 
 * @Version TODO 
 | 
 **/ 
 | 
@Slf4j 
 | 
@RestController 
 | 
@CrossOrigin(origins = "*", maxAge = 3600) 
 | 
@RequestMapping("/system") 
 | 
public class SystemController { 
 | 
  
 | 
    @Autowired 
 | 
    SysAreaService sysAreaService; 
 | 
  
 | 
    @Autowired 
 | 
    ManageLogService manageLogService; 
 | 
  
 | 
  
 | 
    /** 
 | 
     * @Description: 查询地区接口 
 | 
     * @Param: [] 
 | 
     * @return: com.moral.constant.ResultMessage 
 | 
     * @Author: 陈凯裕 
 | 
     * @Date: 2021/4/13 
 | 
     */ 
 | 
    @GetMapping("area/query") 
 | 
    public ResultMessage queryArea() { 
 | 
        List<SysArea> sysAreas = sysAreaService.querySysArea(); 
 | 
        return ResultMessage.ok(sysAreas); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * @Description: 查询日志接口 
 | 
     * @Param: [form] 
 | 
     * @return: com.moral.constant.ResultMessage 
 | 
     * @Author: 陈凯裕 
 | 
     * @Date: 2021/4/13 
 | 
     */ 
 | 
    @GetMapping("log/query") 
 | 
    public ResultMessage queryLog(ManageLogQueryForm form) { 
 | 
  
 | 
        //判断是否缺少参数 
 | 
        if (!form.valid()) 
 | 
            return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), 
 | 
                    ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); 
 | 
  
 | 
        //处理查询业务 
 | 
        ManageLogQueryDTO dto = manageLogService.queryManageLog(form); 
 | 
  
 | 
        //转换前端需要参数 
 | 
        ManageLogQueryVO vo = ManageLogQueryVO.convert(dto); 
 | 
  
 | 
        return new ResultMessage(dto.getCode(), dto.getMsg(), vo); 
 | 
    } 
 | 
  
 | 
  
 | 
  
 | 
  
 | 
} 
 |