Junjie
2024-03-19 ec2e79e0d510568d51714a7121e4a32c026e6d44
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/controller/MapController.java
New file
@@ -0,0 +1,38 @@
package com.zy.asrs.wcs.core.map.controller;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.wcs.core.map.controller.param.MapDataParam;
import com.zy.asrs.wcs.core.map.service.MapService;
import com.zy.asrs.wcs.system.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
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;
/**
 * Created by vincent on 3/15/2024
 */
@RestController
@RequestMapping("/api/map")
public class MapController extends BaseController {
    @Autowired
    private MapService mapService;
    //    @PreAuthorize("hasAuthority('core:map:list')")
    @PostMapping("/list")
    public R mapList() {
        return R.ok().add(mapService.getMapData(getLoginUserId()));
    }
//    @PreAuthorize("hasAuthority('core:map:save')")
    @PostMapping("/save")
    @Transactional
    public R mapSave(@RequestBody MapDataParam param) {
        mapService.saveMapData(param, getLoginUserId());
        return R.ok();
    }
}