| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @ApiOperation(value = "加盟商信息分页查询列表", tags = {"后台-加盟商管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 加盟商信息id |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @ApiOperation(value = "加盟商信息详情", tags = {"后台-加盟商管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param franchisee 加盟商信息信息 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @ApiOperation(value = "新增加盟商信息", tags = {"后台-加盟商管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody @Validated Franchisee franchisee) { |
| | | checkFranchisee(franchisee); |
| | | if (null == franchisee.getAdminPassword() || StringUtils.isBlank(franchisee.getAdminPassword())) { |
| | | throw new GlobalException("请输入管理员初始密码!"); |
| | | } |
| | | //franchisee.setCityStr(String.valueOf(franchisee.getCityArr())); |
| | | return franchiseeService.save(franchisee) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | |
| | | * |
| | | * @param franchisee 加盟商信息信息 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @ApiOperation(value = "修改加盟商信息", tags = {"后台-加盟商管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody @Validated Franchisee franchisee) { |
| | | checkFranchisee(franchisee); |
| | | return franchiseeService.updateById(franchisee) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 启用/关闭加盟商 |
| | | * |
| | | * @param id 加盟商id |
| | | * @param enable 启用/关闭 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @ApiOperation(value = "启用/关闭加盟商", tags = {"后台-加盟商管理"}) |
| | | @GetMapping(value = "/enable") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "加盟商id", name = "id", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "0:关闭;1:启用", name = "enable", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> enable(@RequestParam Integer id, @RequestParam Integer enable) { |
| | | boolean update = franchiseeService.lambdaUpdate().set(Franchisee::getIsEnable, enable) |
| | | .eq(Franchisee::getId, id).update(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param ids 加盟商信息多条id拼接 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @ApiOperation(value = "批量删除加盟商信息", tags = {"后台-加盟商管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |