| @@ -1,19 +1,19 @@ | |||
| package com.simple.controller; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.util.Assert; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxMsg; | |||
| import com.simple.service.WxMsgService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import java.util.Map; | |||
| @RestController | |||
| @RequestMapping("wxMsg") | |||
| @@ -65,7 +65,31 @@ public class WxMsgController extends BaseController | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxMsgService.getById(id)); | |||
| } | |||
| @ApiOperation("短信接口回调") | |||
| @RequestMapping("/receivemsg/{bid}") | |||
| public void receivemsg(@PathVariable String bid,@RequestParam Map<String,String> param) { | |||
| //解析param数据插入数据库中 | |||
| } | |||
| @RequestMapping("/sendmsgbyexcel") | |||
| public ResultData sendmsgbyexcel(@RequestParam("file") MultipartFile file,@RequestBody WxMsg wxMsg) throws Exception { | |||
| if (file.isEmpty()) { | |||
| return new ResultData(Result.SUCCESS,"上传文件不能为空"); | |||
| } | |||
| return wxMsgService.sendmsgbyexcel(file,wxMsg); | |||
| } | |||
| @RequestMapping("/sendmsgbylabel") | |||
| public ResultData sendmsgbylabel(@RequestBody WxMsg wxMsg) throws Exception { | |||
| return wxMsgService.sendmsgbylabel(wxMsg); | |||
| } | |||
| } | |||
| @@ -1,19 +1,16 @@ | |||
| package com.simple.controller; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.util.Assert; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxMsgModel; | |||
| import com.simple.service.WxMsgModelService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| @RestController | |||
| @RequestMapping("wxMsgModel") | |||
| @@ -40,15 +37,13 @@ public class WxMsgModelController extends BaseController | |||
| public ResultData add(@RequestBody WxMsgModel wxMsgModel) { | |||
| //Assert.notNull(wxMsgModel.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxMsgModelService.saveOrUpdate(wxMsgModel); | |||
| return new ResultData(); | |||
| return wxMsgModelService.saveOrUpdate(wxMsgModel); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxMsgModel wxMsgModel) { | |||
| wxMsgModelService.saveOrUpdate(wxMsgModel); | |||
| return new ResultData(); | |||
| return wxMsgModelService.saveOrUpdate(wxMsgModel); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @@ -65,7 +60,7 @@ public class WxMsgModelController extends BaseController | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxMsgModelService.getById(id)); | |||
| } | |||
| } | |||