lisy
2023-06-30 add48c8930d02d58046e89e78b0530c2d5fce32d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
    }
 
}