|
|
|
@@ -0,0 +1,62 @@ |
|
|
|
package com.simple.controller; |
|
|
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.simple.common.Result; |
|
|
|
import com.simple.common.ResultData; |
|
|
|
import com.simple.domain.po.WxGroup; |
|
|
|
import com.simple.service.WxGroupService; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import org.apache.log4j.Logger; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("wxGroup") |
|
|
|
public class WxGroupController extends BaseController |
|
|
|
{ |
|
|
|
@Autowired |
|
|
|
private WxGroupService wxGroupService; |
|
|
|
|
|
|
|
private Logger logger = Logger.getLogger(WxGroupController.class); |
|
|
|
|
|
|
|
@GetMapping("list") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), |
|
|
|
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) |
|
|
|
public ResultData list(@ModelAttribute WxGroup wxGroup,Integer pageNum, Integer pageSize) { |
|
|
|
if (null == wxGroup) wxGroup = new WxGroup(); |
|
|
|
final PageInfo<WxGroup> page = wxGroupService.listAsPage(wxGroup, pageNum, pageSize); |
|
|
|
return new ResultData(page); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("add") |
|
|
|
public ResultData add(@RequestBody WxGroup wxGroup) { |
|
|
|
//Assert.notNull(wxGroup.getName(), "角色名不能为空"); |
|
|
|
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
wxGroupService.saveOrUpdate(wxGroup); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("update") |
|
|
|
public ResultData update(@RequestBody WxGroup wxGroup) { |
|
|
|
wxGroupService.saveOrUpdate(wxGroup); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/del") |
|
|
|
@ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) |
|
|
|
public ResultData delete(String id) { |
|
|
|
wxGroupService.deleteById(id); |
|
|
|
return new ResultData(Result.SUCCESS, "删除成功", null); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/findById") |
|
|
|
@ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) |
|
|
|
public ResultData findById(String id) { |
|
|
|
return new ResultData(Result.SUCCESS,"查询成功",wxGroupService.getById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |