|
|
|
@@ -12,27 +12,36 @@ import org.apache.log4j.Logger; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@RequestMapping("wxMerchant") |
|
|
|
public class WxMerchantController extends BaseController |
|
|
|
{ |
|
|
|
@Autowired |
|
|
|
public class WxMerchantController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private WxMerchantService wxMerchantService; |
|
|
|
|
|
|
|
private Logger logger = Logger.getLogger(WxMerchantController.class); |
|
|
|
|
|
|
|
@ApiOperation("分页列表接口") |
|
|
|
|
|
|
|
@ApiOperation("分页列表接口") |
|
|
|
@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 WxMerchant wxMerchant,Integer pageNum, Integer pageSize) { |
|
|
|
if (null == wxMerchant) wxMerchant = new WxMerchant(); |
|
|
|
@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 WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { |
|
|
|
if (null == wxMerchant) wxMerchant = new WxMerchant(); |
|
|
|
final PageInfo<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); |
|
|
|
return new ResultData(page); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("新增接口") |
|
|
|
@ApiOperation("ETCP商户列表") |
|
|
|
@GetMapping("etcplist") |
|
|
|
public ResultData etcpList(@ModelAttribute WxMerchant wxMerchant) { |
|
|
|
if (null == wxMerchant) wxMerchant = new WxMerchant(); |
|
|
|
final List<WxMerchant> merchantList = wxMerchantService.etcpList(wxMerchant); |
|
|
|
return new ResultData(merchantList); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("新增接口") |
|
|
|
@PostMapping("add") |
|
|
|
public ResultData add(@RequestBody WxMerchant wxMerchant) { |
|
|
|
//Assert.notNull(wxMerchant.getName(), "角色名不能为空"); |
|
|
|
@@ -51,25 +60,25 @@ public class WxMerchantController extends BaseController |
|
|
|
|
|
|
|
@ApiOperation("根据id删除接口") |
|
|
|
@GetMapping("/del") |
|
|
|
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData delete(Long id) { |
|
|
|
wxMerchantService.deleteById(id); |
|
|
|
return new ResultData(Result.SUCCESS, "删除成功", null); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据id查询接口") |
|
|
|
@GetMapping("/findById") |
|
|
|
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) |
|
|
|
|
|
|
|
@ApiOperation("根据id查询接口") |
|
|
|
@GetMapping("/findById") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData findById(Long id) { |
|
|
|
return new ResultData(Result.SUCCESS,"查询成功",wxMerchantService.getById(id)); |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", wxMerchantService.getById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("停用") |
|
|
|
@GetMapping("disable") |
|
|
|
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData disable(Long id) { |
|
|
|
wxMerchantService.disable(id); |
|
|
|
return new ResultData(Result.SUCCESS,"停用成功"); |
|
|
|
return new ResultData(Result.SUCCESS, "停用成功"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |