| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.UserLog; |
| | | import com.whyc.service.UserLogService; |
| | | import com.whyc.util.ExcelUtil; |
| | | 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 javax.servlet.http.HttpServletResponse; |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 用户操作日志 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("userLog") |
| | | @Api(tags = "用户操作事件") |
| | | public class UserLogController { |
| | | @Api(tags = "用户管理-操作事件管理") |
| | | public class UserLogController extends BaseController{ |
| | | |
| | | @Autowired |
| | | private UserLogService service; |
| | | |
| | | @ApiOperation(value = "分页") |
| | | @PostMapping("page") |
| | | public Response<PageInfo<UserLog>> getPage(@RequestParam int pageNum, @RequestParam int pageSize, @RequestBody UserLog userLog){ |
| | | PageInfo<UserLog> pageInfo = service.getPage(pageNum,pageSize,userLog); |
| | | return new Response<PageInfo<UserLog>>().set(1,pageInfo); |
| | | public Response<PageInfo<Object>> getPage(@RequestParam int pageNum, @RequestParam int pageSize, @RequestBody UserLog userLog) throws ParseException { |
| | | //PageInfo<UserLog> pageInfo = service.getPage(pageNum,pageSize,userLog); |
| | | PageInfo<Object> pageInfo = service.getPage2(pageNum,pageSize,userLog); |
| | | return new Response<PageInfo<Object>>().set(1,pageInfo); |
| | | } |
| | | |
| | | @PostMapping("exportExcel") |
| | | @ApiOperation(value = "导出excel",produces = "application/octet-stream") |
| | | public void exportExcel(HttpServletResponse response,@RequestBody List<List<String>> valueList){ |
| | | |
| | | String[][] value = new String[valueList.size()][valueList.get(0).size()]; |
| | | for (int i = 0; i < valueList.size(); i++) { |
| | | for (int j = 0; j < valueList.get(i).size(); j++) { |
| | | value[i][j]=valueList.get(i).get(j); |
| | | } |
| | | } |
| | | service.exportExcel(response,value); |
| | | } |
| | | |
| | | } |