43 lines
1.4 KiB
Java
43 lines
1.4 KiB
Java
|
package com.xkrs.controller;
|
||
|
|
||
|
import com.xkrs.common.encapsulation.PromptMessageEnum;
|
||
|
import com.xkrs.model.entity.FirePointEntity;
|
||
|
import com.xkrs.model.qo.FirePointQo;
|
||
|
import com.xkrs.service.FirePointService;
|
||
|
import org.springframework.context.i18n.LocaleContextHolder;
|
||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
import javax.annotation.Resource;
|
||
|
import java.util.Locale;
|
||
|
|
||
|
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
|
||
|
|
||
|
/**
|
||
|
* @author XinYi Song
|
||
|
*/
|
||
|
@RestController
|
||
|
public class FirePointServiceController {
|
||
|
|
||
|
@Resource
|
||
|
private FirePointService firePointService;
|
||
|
|
||
|
/**
|
||
|
* 添加火点数据
|
||
|
* @param firePointQo
|
||
|
* @return
|
||
|
*/
|
||
|
@PostMapping("/insertFirePoint")
|
||
|
public String insertFirePoint(@RequestBody FirePointQo firePointQo){
|
||
|
// 获取区域信息
|
||
|
Locale locale = LocaleContextHolder.getLocale();
|
||
|
FirePointEntity firePointEntity = firePointService.insertFirePoint(firePointQo);
|
||
|
if(firePointEntity == null){
|
||
|
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"添加数据失败",locale);
|
||
|
}else {
|
||
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"添加成功",locale);
|
||
|
}
|
||
|
}
|
||
|
}
|