Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
style: code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
SakuraPuare committed Jun 18, 2024
1 parent 2662478 commit 160124b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.sakurapuare.flightmanagement.pojo.vo.FlightVO;
import com.sakurapuare.flightmanagement.services.FlightService;
import com.sakurapuare.flightmanagement.services.user.AirlineService;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -55,7 +54,7 @@ public Response<List<FlightVO>> getFlightList(@RequestParam("page") int page, @R

@GetMapping("/my")
public Response<List<FlightVO>> getMyFlightList(@RequestParam("page") int page, @RequestParam("count") int count,
HttpServletRequest request) {
HttpServletRequest request) {
Long userId = Long.parseLong(request.getAttribute("userId").toString());

List<Flight> flightList = flightService.getFlightsByPaginationAndUserId(page, count, userId);
Expand Down Expand Up @@ -106,7 +105,7 @@ public Response<Void> addFlight(@Valid @RequestBody FlightDTO flightDTO, HttpSer

@PutMapping("/{id}")
public Response<Void> updateFlight(@PathVariable(name = "id") long id, @RequestBody FlightDTO flightDTO,
HttpServletRequest request) {
HttpServletRequest request) {
Long userId = Long.parseLong(request.getAttribute("userId").toString());
Airline airline = airlineService.getAirlineByUserId(userId);
// Airline airline = airlineService.getAirlineById(flightDTO.getAirlineId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Response<List<Goods>> getGoodList(@RequestParam("page") int page, @Reques

@GetMapping("/my")
public Response<List<Goods>> getMyGoodList(@RequestParam("page") int page, @RequestParam("count") int count,
HttpServletRequest request) {
HttpServletRequest request) {
Long userId = Long.parseLong(request.getAttribute("userId").toString());
return Response.success(goodsService.getGoodsByPaginationAndUserId(page, count, userId));
}
Expand Down Expand Up @@ -79,7 +79,7 @@ public Response<Void> addGood(@Valid @RequestBody GoodsDTO goodDTO) {

@PutMapping("/{id}")
public Response<Void> updateGood(@PathVariable(name = "id") long id,
@RequestBody GoodsDTO goodDTO) {
@RequestBody GoodsDTO goodDTO) {
Goods good = goodsService.getGoodById(id);
if (good == null) {
return Response.error("Good not found");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
import com.sakurapuare.flightmanagement.pojo.vo.RequestVO;
import com.sakurapuare.flightmanagement.services.RequestService;
import com.sakurapuare.flightmanagement.services.user.UserService;

import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public TicketController(TicketService ticketService, AirlineService airlineServi

@GetMapping("/my")
public Response<List<TicketVO>> getMyTicketList(@RequestParam("page") int page, @RequestParam("count") int count,
HttpServletRequest request) {
HttpServletRequest request) {
Long userId = Long.parseLong(request.getAttribute("userId").toString());

List<Ticket> ticketList = ticketService.getTicketsByPaginationAndUserId(page, count, userId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package com.sakurapuare.flightmanagement.pojo.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import lombok.Data;

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.sakurapuare.flightmanagement.pojo.entity.user.Airline;
import com.sakurapuare.flightmanagement.services.FlightService;
import com.sakurapuare.flightmanagement.services.user.AirlineService;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

Expand All @@ -33,7 +32,7 @@ public class FlightServiceImpl implements FlightService {
private final AirlineService airlineService;

public FlightServiceImpl(FlightMapper flightMapper, TicketMapper ticketMapper, OrderMapper orderMapper,
AirlineService airlineService) {
AirlineService airlineService) {
this.flightMapper = flightMapper;
this.ticketMapper = ticketMapper;
this.orderMapper = orderMapper;
Expand Down Expand Up @@ -110,8 +109,8 @@ public List<Flight> getFlightsByPaginationAndUserId(int page, int count, Long us
Airline airline = airlineService.getAirlineByUserId(userId);
Page<Flight> pagination = new Page<>(page, count);
return flightMapper.selectPage(pagination,
new QueryWrapper<Flight>()
.eq("airline_id", airline.getUserId()))
new QueryWrapper<Flight>()
.eq("airline_id", airline.getUserId()))
.getRecords();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.sakurapuare.flightmanagement.pojo.entity.user.Merchant;
import com.sakurapuare.flightmanagement.services.GoodsService;
import com.sakurapuare.flightmanagement.services.user.MerchantService;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.sakurapuare.flightmanagement.services.FlightService;
import com.sakurapuare.flightmanagement.services.TicketService;
import com.sakurapuare.flightmanagement.services.user.AirlineService;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

Expand All @@ -30,7 +29,7 @@ public class TicketServiceImpl implements TicketService {
private FlightService flightService;

public TicketServiceImpl(TicketMapper ticketMapper, OrderMapper orderMapper, AirlineService airlineService,
FlightService flightService) {
FlightService flightService) {
this.ticketMapper = ticketMapper;
this.orderMapper = orderMapper;
this.airlineService = airlineService;
Expand Down Expand Up @@ -122,9 +121,9 @@ public List<Ticket> getTicketsByPaginationAndUserId(int page, int count, Long us
List<Flight> flights = flightService.getFlightsListByAirlineId(airline.getAirlineId());
Page<Ticket> pagination = new Page<>(page, count);
return ticketMapper.selectPage(pagination,
new QueryWrapper<Ticket>()
.in("flight_id", flights.stream().map(
Flight::getId).toArray()))
new QueryWrapper<Ticket>()
.in("flight_id", flights.stream().map(
Flight::getId).toArray()))
.getRecords();
}

Expand Down
19 changes: 1 addition & 18 deletions web/src/views/home/staff/RequestView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,16 @@ import { TableV2FixedDir } from "element-plus";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import ResizableTableComp from "@/components/ResizableTableComp.vue";
import {
createRequestRequest,
getRequestResponse,
updateRequestRequest,
} from "@/types/request";
import { createRequestRequest, getRequestResponse } from "@/types/request";
import {
cancelRequestAPI,
createRequestAPI,
deleteRequestAPI,
getRequestsListAPI,
handleRequestAPI,
resolveRequestAPI,
updateRequestAPI,
} from "@/apis/requests";
import { DateRender } from "@/utils/date";
// export type Request = {
// userId: number;
// userName: string;
// info: string;
// status: string;
// handlerId: number;
// handlerName: string;
// createdAt: string;
// updatedAt: string;
// };
const columns = [
{
key: "ids",
Expand Down

0 comments on commit 160124b

Please sign in to comment.