|
|
@ -6,12 +6,11 @@ import com.gxwebsoft.shop.entity.ShopMerchant; |
|
|
|
import com.gxwebsoft.shop.param.ShopMerchantParam; |
|
|
|
import com.gxwebsoft.common.core.web.ApiResult; |
|
|
|
import com.gxwebsoft.common.core.web.PageResult; |
|
|
|
import com.gxwebsoft.common.core.web.PageParam; |
|
|
|
import com.gxwebsoft.common.core.web.BatchParam; |
|
|
|
import com.gxwebsoft.common.core.annotation.OperationLog; |
|
|
|
import com.gxwebsoft.common.system.entity.User; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
@ -22,7 +21,7 @@ import java.util.List; |
|
|
|
* 商户控制器 |
|
|
|
* |
|
|
|
* @author 科技小王子 |
|
|
|
* @since 2025-01-11 10:45:12 |
|
|
|
* @since 2025-08-10 20:43:33 |
|
|
|
*/ |
|
|
|
@Tag(name = "商户管理") |
|
|
|
@RestController |
|
|
@ -31,6 +30,7 @@ public class ShopMerchantController extends BaseController { |
|
|
|
@Resource |
|
|
|
private ShopMerchantService shopMerchantService; |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopMerchant:list')") |
|
|
|
@Operation(summary = "分页查询商户") |
|
|
|
@GetMapping("/page") |
|
|
|
public ApiResult<PageResult<ShopMerchant>> page(ShopMerchantParam param) { |
|
|
@ -38,6 +38,7 @@ public class ShopMerchantController extends BaseController { |
|
|
|
return success(shopMerchantService.pageRel(param)); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopMerchant:list')") |
|
|
|
@Operation(summary = "查询全部商户") |
|
|
|
@GetMapping() |
|
|
|
public ApiResult<List<ShopMerchant>> list(ShopMerchantParam param) { |
|
|
@ -53,6 +54,8 @@ public class ShopMerchantController extends BaseController { |
|
|
|
return success(shopMerchantService.getByIdRel(id)); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopMerchant:save')") |
|
|
|
@OperationLog |
|
|
|
@Operation(summary = "添加商户") |
|
|
|
@PostMapping() |
|
|
|
public ApiResult<?> save(@RequestBody ShopMerchant shopMerchant) { |
|
|
@ -67,6 +70,8 @@ public class ShopMerchantController extends BaseController { |
|
|
|
return fail("添加失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopMerchant:update')") |
|
|
|
@OperationLog |
|
|
|
@Operation(summary = "修改商户") |
|
|
|
@PutMapping() |
|
|
|
public ApiResult<?> update(@RequestBody ShopMerchant shopMerchant) { |
|
|
@ -76,6 +81,8 @@ public class ShopMerchantController extends BaseController { |
|
|
|
return fail("修改失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopMerchant:remove')") |
|
|
|
@OperationLog |
|
|
|
@Operation(summary = "删除商户") |
|
|
|
@DeleteMapping("/{id}") |
|
|
|
public ApiResult<?> remove(@PathVariable("id") Integer id) { |
|
|
@ -85,6 +92,8 @@ public class ShopMerchantController extends BaseController { |
|
|
|
return fail("删除失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopMerchant:save')") |
|
|
|
@OperationLog |
|
|
|
@Operation(summary = "批量添加商户") |
|
|
|
@PostMapping("/batch") |
|
|
|
public ApiResult<?> saveBatch(@RequestBody List<ShopMerchant> list) { |
|
|
@ -94,6 +103,8 @@ public class ShopMerchantController extends BaseController { |
|
|
|
return fail("添加失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopMerchant:update')") |
|
|
|
@OperationLog |
|
|
|
@Operation(summary = "批量修改商户") |
|
|
|
@PutMapping("/batch") |
|
|
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopMerchant> batchParam) { |
|
|
@ -103,6 +114,8 @@ public class ShopMerchantController extends BaseController { |
|
|
|
return fail("修改失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopMerchant:remove')") |
|
|
|
@OperationLog |
|
|
|
@Operation(summary = "批量删除商户") |
|
|
|
@DeleteMapping("/batch") |
|
|
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) { |
|
|
|