package com.dsh.other.controller; import com.dsh.other.entity.Store; import com.dsh.other.feignclient.model.StoreDetailOfCourse; import com.dsh.other.service.StoreService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/base/protocol") public class StoreController { @Autowired private StoreService stoService; @PostMapping("/storeDetail/courseOfSto") public StoreDetailOfCourse getCourseOfStore(@RequestBody Integer storeId){ StoreDetailOfCourse ofCourse = new StoreDetailOfCourse(); Store store = stoService.getById(storeId); if (null != store){ ofCourse.setStoreName(store.getName()); ofCourse.setStoreAddr(store.getAddress()); } return ofCourse; } }