GeoPremiseController.java 1.08 KB
package com.bsth.controller;

import com.bsth.common.ResponseCode;
import com.bsth.entity.GeoPremise;
import com.bsth.service.GeoPremiseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Hill
 */
@RestController
@RequestMapping("/api/geopremise")
public class GeoPremiseController extends BaseController<GeoPremise, Integer> {

    @Autowired
    private GeoPremiseService geoPremiseService;

    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Map<String, Object> save(GeoPremise geoPremise) {
        Map<String, Object> result = new HashMap<>();
        try {
            result.putAll(geoPremiseService.save(geoPremise));
            result.put("status", ResponseCode.SUCCESS);
        } catch (Exception e) {
            result.put("status", ResponseCode.ERROR);
        }

        return result;
    }
}