|
@@ -6,6 +6,8 @@ import com.jpsoft.smart.modules.base.service.InformationInfoService;
|
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.smart.modules.common.dto.Sort;
|
|
|
import com.jpsoft.smart.modules.common.utils.PojoUtils;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
@@ -36,38 +38,6 @@ public class InformationInfoController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value="添加信息")
|
|
|
- @PostMapping("addMobile")
|
|
|
- public MessageResult<InformationInfo> addMobile(@RequestBody InformationInfo informationInfo,@RequestAttribute String subject){
|
|
|
- MessageResult<InformationInfo> msgResult = new MessageResult<>();
|
|
|
-
|
|
|
- try {
|
|
|
- informationInfo.setId(UUID.randomUUID().toString());
|
|
|
- informationInfo.setDelFlag(false);
|
|
|
- informationInfo.setCreateBy(subject);
|
|
|
- informationInfo.setCreateTime(new Date());
|
|
|
- informationInfo.setStatus("0");
|
|
|
-
|
|
|
- int affectCount = informationInfoService.insert(informationInfo);
|
|
|
-
|
|
|
- if (affectCount > 0) {
|
|
|
- msgResult.setResult(true);
|
|
|
- msgResult.setData(informationInfo);
|
|
|
- } else {
|
|
|
- msgResult.setResult(false);
|
|
|
- msgResult.setMessage("数据库添加失败");
|
|
|
- }
|
|
|
- }
|
|
|
- catch(Exception ex){
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
-
|
|
|
- msgResult.setResult(false);
|
|
|
- msgResult.setMessage(ex.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- return msgResult;
|
|
|
- }
|
|
|
-
|
|
|
@ApiOperation(value="添加信息")
|
|
|
@PostMapping("add")
|
|
|
public MessageResult<InformationInfo> add(@RequestBody InformationInfo informationInfo,@RequestAttribute String subject){
|
|
@@ -265,4 +235,48 @@ public class InformationInfoController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value="addMobile")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name="ownerId",value="户主ID",dataType="string",paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="content",value="内容",dataType="string",paramType = "query"),
|
|
|
+ @ApiImplicitParam(name="type",value="类型/1投诉/2报修",dataType="string",paramType = "query")
|
|
|
+ })
|
|
|
+ public MessageResult<InformationInfo> addMobile(
|
|
|
+ String ownerId,
|
|
|
+ String content,
|
|
|
+ String type){
|
|
|
+ MessageResult<InformationInfo> msgResult = new MessageResult<>();
|
|
|
+ InformationInfo informationInfo = new InformationInfo();
|
|
|
+ try {
|
|
|
+ informationInfo.setId(UUID.randomUUID().toString());
|
|
|
+ informationInfo.setDelFlag(false);
|
|
|
+ informationInfo.setCreateBy(ownerId);
|
|
|
+ informationInfo.setCreateTime(new Date());
|
|
|
+ informationInfo.setStatus("0");
|
|
|
+ informationInfo.setContent(content);
|
|
|
+ informationInfo.setOwnerId(ownerId);
|
|
|
+ informationInfo.setType(type);
|
|
|
+ informationInfo.setCommunity("1-2-1601");
|
|
|
+
|
|
|
+ int affectCount = informationInfoService.insert(informationInfo);
|
|
|
+
|
|
|
+ if (affectCount > 0) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(informationInfo);
|
|
|
+ } else {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库添加失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|