Based on java springboot, Alibaba P8 explained it in person

Keywords: Java Back-end Programmer

import hue.edu.xiong.volunteer_travel.core.Result;

import hue.edu.xiong.volunteer_travel.core.ResultGenerator;

import hue.edu.xiong.volunteer_travel.model.*;

import hue.edu.xiong.volunteer_travel.service.SystemService;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.data.domain.Page;

import org.springframework.data.domain.Pageable;

import org.springframework.data.web.PageableDefault;

import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

@Controller

@RequestMapping("/system")

public class SystemController {

@Autowired

private SystemService systemService;





@RequestMapping("")

public String loginUI() {

    return "system/login/login";

}



@RequestMapping("/login")

@ResponseBody

public Result login(SysUser sysUser, HttpServletResponse response) {



   return systemService.login(sysUser,response);

}

@RequestMapping("/userListUI")

public String userListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {

    Page<User> page = systemService.getUserPage(pageable);

    model.addAttribute("page",page);

    return "system/user/list";

}



@RequestMapping("/saveUser")

@ResponseBody

public Result saveUser(User user) {

    return systemService.saveUser(user);

}



@RequestMapping("/getUserById")

@ResponseBody

public Result getUserById(String id) {

    return ResultGenerator.genSuccessResult(systemService.getUserById(id));

}







@RequestMapping("/logout")

public String logout(HttpServletRequest request, HttpServletResponse response) {

   systemService.logout(request,response);

    return "redirect:/system";

}



@RequestMapping("/hotelListUI")

public String hotelListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {

    Page<Hotel> page = systemService.getHotelPage(pageable);

    model.addAttribute("page", page);

    return "system/hotel/list";

}



@RequestMapping("/saveHotel")

@ResponseBody

public Result saveHotel(Hotel hotel) {

    return systemService.saveHotel(hotel);

}



@RequestMapping("/updateStatus")

@ResponseBody

public Result updateStatus(String id) {

    return systemService.updateStatus(id);

}



@RequestMapping("/getHotelById")

@ResponseBody

public Result getHotelById(String id) {

    return ResultGenerator.genSuccessResult(systemService.getHotelById(id));

}



@RequestMapping("/attractionsListUI")

public String attractionsListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {

    Page<Attractions> page = systemService.getAttractionsPage(pageable);

    model.addAttribute("page", page);

    return "system/attractions/list";

}



@RequestMapping("/getAttractionsById")

@ResponseBody

public Result getAttractionsById(String id) {

    return ResultGenerator.genSuccessResult(systemService.getAttractionsById(id));

}



@RequestMapping("/updateAttractionsStatus")

@ResponseBody

public Result updateAttractionsStatus(String id) {

    return systemService.updateAttractionsStatus(id);

}



@RequestMapping("/saveAttractions")

@ResponseBody

public Result saveAttractions(Attractions attractions) {

    return systemService.saveAttractions(attractions);

}



@RequestMapping("/travelRouteListUI")

public String travelRouteListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {

    Page<TravelRoute> page = systemService.getTravelRoutePage(pageable);

    model.addAttribute("page", page);

    return "system/route/list";

}



@RequestMapping("/getTravelRouteById")

@ResponseBody

public Result getTravelRouteById(String id) {

    return ResultGenerator.genSuccessResult(systemService.getTravelRouteById(id));

}



@RequestMapping("/updateTravelRouteStatus")

@ResponseBody

public Result updateTravelRouteStatus(String id) {

    return systemService.updateTravelRouteStatus(id);

}



@RequestMapping("/saveTravelRoute")

@ResponseBody

public Result saveTravelRoute(TravelRoute travelRoute) {

    return systemService.saveTravelRoute(travelRoute);

}



@RequestMapping("/travelStrategyListUI")

public String travelStrategyListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {

    Page<TravelStrategy> page = systemService.getTravelStrategyPage(pageable);

    model.addAttribute("page", page);

    return "system/strategy/list";

}



@RequestMapping("/getTravelStrategyById")

Ending

Tip: due to the limited length of the article, there are still 20 questions about MySQL below. I have redone them and sorted them into a pdf document. I will show you the directory of the remaining questions later

**[CodeChina open source project: [analysis of Java interview questions of first-line large manufacturers + core summary learning notes + latest explanation Video]](

)**

If you think it's helpful, you might as well [forward + like + follow] to support me. In the future, we will bring you more technical articles and learning articles! (ALI asks a lot about the underlying implementation of MySQL and index Implementation)

After reading this pdf, you can also talk about MySQL with the interviewer. In fact, the needs of Alibaba p7 post are not so difficult (but not simple). Solid Java foundation + no short board knowledge + in-depth learning of some open source technologies + reading the source code + algorithm brush questions. This set of p7 post is almost no problem. I still hope everyone can get a high salary offer.

This article has been CodeChina open source project: [analysis of Java interview questions of front-line large manufacturers + core summary learning notes + real project practice + latest explanation Video] Collection, self-study programming route and series of technical articles are constantly updated

Medium... (img-p3wm6kge-163125958384)]

After reading this pdf, you can also talk about MySQL with the interviewer. In fact, the needs of Alibaba p7 post are not so difficult (but not simple). Solid Java foundation + no short board knowledge + in-depth learning of some open source technologies + reading the source code + algorithm brush questions. This set of p7 post is almost no problem. I still hope everyone can get a high salary offer.

This article has been CodeChina open source project: [analysis of Java interview questions of front-line large manufacturers + core summary learning notes + real project practice + latest explanation Video] Collection, self-study programming route and series of technical articles are constantly updated

Posted by ts2000abc on Fri, 19 Nov 2021 20:17:02 -0800